Closed hubgit closed 7 years ago
Yes, that's why Case.sentence takes two arguments. The first is the string to be case-corrected, the second is an array of proper names to be capitalized. Is that not working?
Obviously, i can't embed every possible proper name into this library. I see no other way to do it.
In this instance I'm using Case.of
to detect the case of a string to verify that it's sentence case, and I think Case.of
doesn't take any extra arguments.
Perhaps the test could allow up to a certain percentage of words to be capitalised?
If not, no worries - I can use a bespoke function for this test.
Ah, Case.of makes more sense. It might not be hard to add support for the second argument. Percentage capitalized, on the other hand, might be awkward to implement given the way i've built Case with regexps. I'll think on this. Seems like the 2nd argument should at least be supported.
As well as the first letter, sentence case strings can contain capital letters in cases such as proper nouns and acronyms.
For example, this title should be identified as sentence case: "Skin microbiota in frogs from the Brazilian Atlantic Forest: species, forest type, and potential against pathogens".