akshaynagpal / w2n

Convert number words (eg. twenty one) to numeric digits (21)
http://w2n.readthedocs.io
MIT License
167 stars 78 forks source link

Add regex to fix comma bug #36

Open jnelson16 opened 5 years ago

jnelson16 commented 5 years ago

Commas between numbers were not being recognized because of the way the words were being split. This pull request uses re.findall() to split the sentence into words, ignoring commas and other punctuation between the words.

codecov[bot] commented 5 years ago

Codecov Report

Merging #36 into master will increase coverage by 0.05%. The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #36      +/-   ##
==========================================
+ Coverage    96.8%   96.85%   +0.05%     
==========================================
  Files           2        2              
  Lines         125      127       +2     
==========================================
+ Hits          121      123       +2     
  Misses          4        4
Impacted Files Coverage Δ
word2number/w2n.py 95.18% <100%> (+0.05%) :arrow_up:
unit_testing.py 100% <100%> (ø) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 33aac8a...0af820e. Read the comment docs.