You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Complement str_to_lower(), str_to_upper() and str_to_title with a function for capitalising the first word in each sentence. The only problem is that stringi does not see a dot followed by a lower case letter as a sentence break. That should probably be documented, or it will lead to confusion. It would still be a useful function for me though.
> stri_trans_totitle("it works. but not always. now? yes! indeed; but not with dot. lowercase.", stri_opts_brkiter('sentence'))
[1] "It works. but not always. now? Yes! Indeed; but not with dot. lowercase."
With stri_trans_totitle, if word BreakIterator is used (the default), then the first letter of each word will be capitalized and the rest will be transformed to lower case. With a break iterator of type sentence, the first letter of each sentence will be capitalized only. Note that according the ICU User Guide, the string "one. two. three." consists of one sentence.
Yes, it is a dup. I wanted a function to convert lowercase text to sentence case. However, stringi does not see a full-stop followed by a lower case letter as a sentence boundary.
Complement
str_to_lower()
,str_to_upper()
andstr_to_title
with a function for capitalising the first word in each sentence. The only problem is that stringi does not see a dot followed by a lower case letter as a sentence break. That should probably be documented, or it will lead to confusion. It would still be a useful function for me though.From stringi
Unicode sentence bounderies
Relevant issue: #27
The text was updated successfully, but these errors were encountered: