Skip to content

Instantly share code, notes, and snippets.

View leoniedu's full-sized avatar

Eduardo Leoni leoniedu

  • IBGE
  • Salvador, Brazil
View GitHub Profile
@leoniedu
leoniedu / toTitleCasePT.R
Last active September 12, 2024 15:22 — forked from jjesusfilho/toTitleCasePT.R
Converts Portuguese strings to Title Case
#' Convertion to title case with lower case for some classes of words.
#'
#' In written Portuguese, when converting to title case, it is not usual
#' to keep in title case some words, like prepositions, conjunctions,
#' articles and some kinds of pronouns. This functions locates those
#' cases and converts them to lower case. Based on gist ToTitleCasePT https://gist.github.com/jjesusfilho/454192db8356eb9c486a02698338221a by https://github.com/jjesusfilho
#'
#' @param string vector of characters to be converted to title case
#' but with connector words (one-word prepositions and conjunctions)
#' and articles (both definite and indefinite) and some pronouns