Skip to content

Terms with only consonants should be ALL CAPS - #53

Merged
ppannuto merged 1 commit into
ppannuto:masterfrom
Garrett-R:master
May 4, 2020
Merged

Terms with only consonants should be ALL CAPS#53
ppannuto merged 1 commit into
ppannuto:masterfrom
Garrett-R:master

Conversation

@Garrett-R

Copy link
Copy Markdown
Contributor

Thought this heuristic might be a useful addition...

@coveralls

coveralls commented May 2, 2020

Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.6%) to 82.927% when pulling 6d8a4f7 on Garrett-R:master into 35192bf on ppannuto:master.

Comment thread titlecase/tests.py

def test_callback():
def abbreviation(word, **kwargs):
if word.upper() in ('TCP', 'UDP'):

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the reason for changing this from TCP to SAML? (Particularly in lieu of just adding SAML?)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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" ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yes, great point, that is better. I've just made that change.

@Garrett-R
Garrett-R requested a review from ppannuto May 4, 2020 13:22

@ppannuto ppannuto left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great, thanks!

@ppannuto
ppannuto merged commit f7ae65c into ppannuto:master May 4, 2020
@Garrett-R

Copy link
Copy Markdown
Contributor Author

Awesome and thanks for a great package!

ppannuto added a commit that referenced this pull request Jun 12, 2020
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!!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants