Terms with only consonants should be ALL CAPS - #53
Conversation
|
|
||
| def test_callback(): | ||
| def abbreviation(word, **kwargs): | ||
| if word.upper() in ('TCP', 'UDP'): |
There was a problem hiding this comment.
What's the reason for changing this from TCP to SAML? (Particularly in lieu of just adding SAML?)
There was a problem hiding this comment.
Oh right, forgot to explain that. Since this PR make terms that are made purely of consonants be identified as acronyms, it causes this test to fail. That's because titlecase will output "TCP" by default now rather than "Tcp".
Changed to SAML since that has a vowel in it, so is immune to this PR's change in logic.
There was a problem hiding this comment.
Ah, that makes sense. I think I'd actually rather keep tcp in there, but just update the test to adapt to this PR's behavior. I view the tests slightly as a self-documenting understanding of what the library will do.
Could you update and add a comment to test that explains something like "the library is able to guess that all-consonant words are acronyms, so TCP works naturally, but others will require the custom list" ?
There was a problem hiding this comment.
Ah yes, great point, that is better. I've just made that change.
|
Awesome and thanks for a great package! |
Lots of updates, thanks to one and all. This will be the last release with Py2k support and the last release before declaring a v1.0. Updates: - #35: Add fancy double quote to punctuation; Thanks @dwaynebailey! - #45: Fix deprecation warning regarding invalid escape sequences. Thanks @tirkarthi - #46: Add support for titlecasing non-ASCII letters; Thanks @acabal! - #47: Add sphinx documentation to titlecase function; Thanks @1kastner! - #49: Remove closing bracket in parser help text; Thanks @1kastner! - #53: Add table with examples; Thanks @1kastner! - #53: Terms with only consonants should be ALL CAPS; Thanks @Garret-R! - #54: setup.py: Read version from __init__.py to avoid importing the module Major thanks for unblocking this @iburago!!
Thought this heuristic might be a useful addition...