jkomoros / card-web

The web app behind thecompendium.cards
Apache License 2.0
46 stars 8 forks source link

Card titles and fingerprints should not title-case automatically #652

Closed jkomoros closed 1 year ago

jkomoros commented 1 year ago

Or rather, they shouldn't for words with ATyPical capitalization.

Right now acroynyms like SMEs and IDs get changed to "Ids" and "Smes". It should only forcibly title case words that don't start with an uppercase letter, and just leave alone any other words.

And add a maintenance task to do this for old cards

jkomoros commented 1 year ago

625 also talks a bit about uppercase words handling

jkomoros commented 1 year ago

Update capitalizeTitleWord to return false if the first character is already title case

jkomoros commented 1 year ago

Hmmm this is quite a bit harder, because the actual original-case text is discarded at the beginning of the processing, so it doesn't even exist to pass to capitalizeTitleWord (its all lower case by then)

We could have normalizeWords in ProcessedRun constructor not lowercase, and just remove punctuation, etc... but then later we really do want them to be all lowercase, and saving all of the processed runs seems very wasteful

jkomoros commented 1 year ago

Update extractOriginalNgramFromRun to accept an originalCase boolean. If it provided, then it computes its normalized-original-case string to use instead of using run.normalized.

jkomoros commented 1 year ago