TheRenegadeCoder / image-titler

An image title generator using The Renegade Coder style
https://therenegadecoder.com
GNU General Public License v3.0
17 stars 6 forks source link

Add a Set of Abbreviations to Add to Titlecase #12

Closed jrg94 closed 4 years ago

jrg94 commented 5 years ago

Apparently, titlecase has a feature which allows you to define addition terms for lookup. The example they give:

>>> def abbreviations(word, **kwargs):
...   if word.upper() in ('TCP', 'UDP'):
...     return word.upper()
...
>>> titlecase.titlecase('a simple tcp and udp wrapper', callback=abbreviations)
'A Simple TCP and UDP Wrapper'

There have been times where this would have been handy instead of using the -t feature of image-titler. That said, I don't remember any terms off hand that I'd want to add.

jrg94 commented 4 years ago

I don't think I'm going to pull through with this. It just doesn't make sense to try to maintain a dictionary of abbreviations. I'd prefer to leave this up to the user for now. Perhaps in the future we could add a flag that points to a file that contains a list of custom abbreviations.