allo-media / text2num

Parse and convert numbers written in French, English, Spanish, Portuguese, German and Catalan into their digit representation.
https://text2num.readthedocs.io
MIT License
102 stars 47 forks source link

German support proposal (update) #55

Closed fquirin closed 3 years ago

fquirin commented 3 years ago

I've taken the existing 'german-support-proposal' branch, updated it to include the latest master changes and tried to fix the most urgent open tasks :sweat_smile:

This work builds on: https://github.com/allo-media/text2num/pull/46

Since German language support is taking the current library architecture to it's limits I've tried to introduce a few more interfaces and methods:

Overall I think German support is not very well optimized yet but I managed to survive all the test cases ^^.

I strongly recommend to label this 'German BETA' but include it in the next version so we can start to improve general architecture (German will not be the only language with these issues, I'm thinking of Turkish for example as well) and to iterate more easily because if the master keeps evolving without these changes the next try to add support for German will start from zero again :-/

[EDIT] Btw I've fixed the errors shown by mypy but there is one in transforms.py that makes no sense ^^

fquirin commented 3 years ago

@rtxm do you think its likely that this PR might end up in the master? Because if not I probably have to continue working with the fork and the version might diverge too far for another PR at some point :-/

rtxm commented 3 years ago

Thank you for this valuable contribution! Merging now!