cannawen / metric_units_reddit_bot

Reddit bot converting imperial units to metric units
https://www.reddit.com/user/metric_units
GNU General Public License v3.0
78 stars 34 forks source link

Add support for fractions #44

Closed nalinbhardwaj closed 6 years ago

nalinbhardwaj commented 6 years ago

Adding support for fractions in comments to handle queries like 1 5/6 inches, 3/4 oz etc.

Adds function preprocessComment to replace fractions in preprocessing. fractionProcessor works by first removing all occurrences of mixed values, then fractions, in that order of priority.

Allows mixed values to seperated by space or + symbol, and ends with space, or -

Fixes #150962141

cannawen commented 6 years ago

Sweet, thank you for the PR! This change will be in the next release, v0.11.7 :)