Stopwords: Stopwords Class

StopwordsR Documentation

Stopwords Class

Description

Stopwords is for filter result.

Methods

Public methods


Method print()

print method for Stopwords objects

Usage
Stopwords$print(x, ...)
Arguments
x

self

...

ignored


Method new()

Create a stopwords object for filter stopwords on analyze() and tokenize() results.

Usage
Stopwords$new(use_system_dict = TRUE)
Arguments
use_system_dict

bool(optional): use system stopwords dictionary or not. Defualt is TRUE.


Method add()

add stopword one at a time.

Usage
Stopwords$add(form = NA, tag = Tags$nnp)
Arguments
form

char(optional): Form information. Default is NA.

tag

char(optional): Tag information. Default is "NNP". Please check Tags.

Examples
 \dontrun{
  sw <- Stopwords$new()
  sw$add("word", "NNG")
  sw$add("word", Tags$nng)
  }

Method add_from_dict()

add stopword from text file. text file need to form "TEXT/TAG". TEXT can remove like "/NNP". TAG required like "FORM/NNP".

Usage
Stopwords$add_from_dict(path, dict_name = "user")
Arguments
path

char(required): dictionary file path.

dict_name

char(optional): default is "user"


Method remove()

remove stopword one at a time.

Usage
Stopwords$remove(form = NULL, tag = NULL)
Arguments
form

char(optional): Form information. If form not set, remove tag in input.

tag

char(required): Tag information. Please check Tags.


Method save_dict()

save current stopwords list in text file.

Usage
Stopwords$save_dict(path)
Arguments
path

char(required): file path to save stopwords list.


Method get()

return tibble of stopwords.

Usage
Stopwords$get()
Returns

a tibble for stopwords options for analyze() / tokenize() function.


Method clone()

The objects of this class are cloneable with this method.

Usage
Stopwords$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

Examples

## Not run: 
  Stopwords$new()

## End(Not run)

## ------------------------------------------------
## Method `Stopwords$add`
## ------------------------------------------------

 ## Not run: 
  sw <- Stopwords$new()
  sw$add("word", "NNG")
  sw$add("word", Tags$nng)
  
## End(Not run)

elbird documentation built on Aug. 12, 2022, 5:08 p.m.