Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add str_to_capitalised() #231

Closed
foldager opened this issue Mar 29, 2018 · 3 comments
Closed

Add str_to_capitalised() #231

foldager opened this issue Mar 29, 2018 · 3 comments

Comments

@foldager
Copy link

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."

From stringi

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.

Unicode sentence bounderies

Relevant issue: #27

@hadley
Copy link
Member

hadley commented May 8, 2018

I don't really understand what you are asking for here. Can you please clarify?

@hadley
Copy link
Member

hadley commented May 8, 2018

Is this a duplicate of #202?

@foldager
Copy link
Author

foldager commented May 8, 2018

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants