jaraco / inflect

Correctly generate plurals, ordinals, indefinite articles; convert numbers to words
https://pypi.org/project/inflect
MIT License
960 stars 107 forks source link

Consolidate logic for handling prepositional phrases separated by dashes and spaces. #153

Closed jaraco closed 2 years ago

jaraco commented 2 years ago

This change reduces the mccabe complexity for _plnoun and _sinoun by 3 and 8 respectively:

inflect main $ .tox/python/bin/python -m mccabe inflect/__init__.py | grep _..noun
2638:4: 'engine._plnoun' 91
3078:4: 'engine._sinoun' 100
inflect main $ git checkout refactor/prepositional-phrase-handler
Switched to branch 'refactor/prepositional-phrase-handler'
Your branch is up to date with 'origin/refactor/prepositional-phrase-handler'.
inflect refactor/prepositional-phrase-handler $ .tox/python/bin/python -m mccabe inflect/__init__.py | grep _..noun
2640:4: 'engine._plnoun' 88
3110:4: 'engine._sinoun' 92