voca icon indicating copy to clipboard operation
voca copied to clipboard

Voca's title case function is capitalizing some words it shouldn't

Open LandonSchropp opened this issue 5 years ago • 4 comments

Expected behavior :smile_cat:

When title casing an abbreviation, Voca capitalizes some words it shouldn't, like to or a. I realize this can get pretty complicated or can vary between styles, but it seems to me that it still be helpful to have a function that followed the general rules.

voca.titleCase("bruce willis is a badass") // => "Bruce Willis is a Badass"

Actual behavior :crying_cat_face:

Voca capitalizes those words.

voca.titleCase("bruce willis is a badass") // => 'Bruce Willis Is A Badass'

Steps to reproduce :construction_worker:

Call the functions as described above.

Technical details: :wrench:

Browser/OS type: macOS 10.15.3 Node version: 13

LandonSchropp avatar Apr 27 '20 01:04 LandonSchropp

Voca library isn't created specifically for English language, thus I cannot incorporate is or a into the function as a special case.

In the longterm, I plan to make some improvements to incorporate behavior by locale.

panzerdp avatar Sep 12 '20 12:09 panzerdp