akshaynagpal / w2n

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

Return None result if no wordnumbers found, print error. #6

Closed bpben closed 7 years ago

bpben commented 8 years ago

Hi there, I ran into an issue with the new fix to the IndexError problem. I had w2n incorporated into a function of mine and counted on an IndexError to move on to the next part. With the printed error, I was getting that error message returned as part of the function's result. I tried making a quick fix of that, having it print the error instead and return a None result.

Is that helpful? I'm a bit of a git newbie, so let me know if I'm contributing incorrectly here. Thanks for a useful library!

akshaynagpal commented 8 years ago

Hi @bpben . I am glad you found my library useful. And yes, you are contributing at the correct place. Forking, editing and merging is the correct way to contribute. Regarding the pull request, I am a bit busy right now (working on a new open source project), but I will definitely see your suggested modification and will decide whether this is needed for a wider use case or not. If it is, it will be included in the next release. Keep contributing! Cheers!

akshaynagpal commented 7 years ago

@bpben Added None result and printing of error. Thanks a lot!