Skip to contents

Grammar check a text

Usage

check_text(text, language = "auto")

Arguments

text

character. A character object with text to be check.

language

character. Code like en-US, fr-FR, etc. Or auto (default) for automatic language detection. Use get_languages() to get a list of supported languages at the LanguageTool API.

Value

a tibble with grammar checks.

Examples

check_text("O rato roeu a roupa do rei de roma.", language = "pt-BR")
#> # A tibble: 1 × 11
#>   message          shortMessage replacements offset length context      sentence
#>   <chr>            <chr>        <list>        <int>  <int> <list>       <chr>   
#> 1 Encontrado poss… Erro ortogr… <list>           30      4 <named list> O rato …
#> # ℹ 4 more variables: type <list>, rule <list>,
#> #   ignoreForIncompleteSentence <lgl>, contextForSureMatch <int>
check_text("Bernardo climb the stairs to the castle’s ramparts.", language = "auto")
#> # A tibble: 1 × 11
#>   message          shortMessage replacements offset length context      sentence
#>   <chr>            <chr>        <list>        <int>  <int> <list>       <chr>   
#> 1 The singular pr… Agreement e… <list [2]>        9      5 <named list> Bernard…
#> # ℹ 4 more variables: type <list>, rule <list>,
#> #   ignoreForIncompleteSentence <lgl>, contextForSureMatch <int>