given a text and a vector of entities, it substitutes the spaces with underscores, so the entities are identified.

subs_ppn(text, entities, method = "normal")

Arguments

text

an input text

entities

an input vector, as exported by `extract_entity()`

Examples

texto_teste <- "José da Silva e Fulano de Tal foram, bla Maria Silva. E depois disso, bla Joaquim José da Silva Xavier no STF"
ppn <- texto_teste |> extract_entity(connectors("pt"), sw = gen_stopwords("pt"))
texto_teste |> subs_ppn(ppn)
#> [1] "José_da_Silva e Fulano_de_Tal foram, bla Maria_Silva. E depois disso, bla Joaquim_José_da_Silva_Xavier no STF"
texto_teste |> subs_ppn(ppn, method = "loop")
#> processing 1 of 5
#> processing 2 of 5
#> processing 3 of 5
#> processing 4 of 5
#> processing 5 of 5
#> [1] "José_da_Silva e Fulano_de_Tal foram, bla Maria_Silva. E depois disso, bla Joaquim_José_da_Silva_Xavier no STF"
text <- texto_teste |> subs_ppn(ppn)
texd
#> Error in eval(expr, envir, enclos): object 'texd' not found