normalizzaTesti: Varie funzioni di normalizzazione del testo

Description Usage Arguments Details Value Examples

View source: R/normalizzaTesti.R

Description

Varie funzioni di normalizzazione del testo

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
normalizzaTesti(
  testo,
  tolower = TRUE,
  normalizzahtml = TRUE,
  normalizzacaratteri = TRUE,
  normalizzaemote = TRUE,
  normalizzaEmoticons = TRUE,
  normalizzapunteggiatura = TRUE,
  normalizzaslang = TRUE,
  fixed = TRUE,
  perl = TRUE,
  preprocessingEncoding = TRUE,
  encoding = "UTF-8",
  sub = "",
  contaStringhe = c("\\?", "\\!", "@", "#", "(\200|euro)", "(\\$|dollar)",
    "SUPPRESSEDTEXT"),
  suppressInvalidTexts = TRUE,
  verbatim = TRUE,
  remove = TRUE,
  removeUnderscore = FALSE
)

Arguments

testo

character vector of texts

tolower

TRUE by default

normalizzahtml

TRUE by default

normalizzacaratteri

TRUE by default

normalizzaemote

TRUE by default

normalizzaEmoticons

TRUE by default

normalizzapunteggiatura

TRUE by default

normalizzaslang

TRUE by default

fixed

vedi base:gsub. Preferibilmente non usare l'opzione.

perl

vedi base:gsub. Preferibilmente non usare l'opzione.

preprocessingEncoding

logical

encoding

"UTF-8" default. Se FALSE evita la conversione.

sub

character string. If not NA it is used to replace any non-convertible bytes in the input. See also parameter sub in function iconv.

contaStringhe

stringhe da contare nei documenti. Default: c("\?","\!","#","@", "(€|euro)","(\$|dollar)","SUPPRESSEDTEXT")

suppressInvalidTexts

Sostituisce con "SUPPRESSEDTEXT" le stringhe con mutibyte non valida (che produrrebbero verosimilmente errori nelle successive normalizzazioni). Default TRUE.

verbatim

Mostra statitiche durante il processo. Default TRUE

remove

TRUE by default. Possibily, a vector of stopwords to be removed.

removeUnderscore

rimuovere gli underscore?

ifErrorReturnText

what to return for tests with a wrong encoding.

stopwords

Lista di parole da escludere dall'analisi. A list of words to be excluded from the process. itastopwords by default.

Details

itastopwords e' una lista di stopwords italiane.

Value

Per normalizzaTesti l'output e' il vettore di testi normalizzati. La tabella dei conteggi specificati in contaStringhe e' assegnato come tabella counts tra gli attributes del vettore stesso.

Per tutte le altre funzioni, l'output e' un vector della stessa lunghezza di testo ma con testi normalizzati.

Examples

1
2
3
testoNorm <- normalizzaTesti(c('ciao bella!','www.associazionerospo.org','noooo, che grandeeeeee!!!!!','mitticooo', 'mai possibile?!?!'))
testoNorm
attr(testoNorm,"counts")

livioivil/TextWiller documentation built on Nov. 30, 2020, 3:17 a.m.