Coerce objects to sbo_dictionary
class.
as_sbo_dictionary(x, ...) # S3 method for character as_sbo_dictionary(x, .preprocess = identity, EOS = "", ...)
x | object to be coerced. |
---|---|
... | further arguments passed to or from other methods. |
.preprocess | a function for corpus preprocessing. |
EOS | a length one character vector listing all (single character) end-of-sentence tokens. |
A sbo_dictionary
object.
This function is an S3 generic for coercing existing objects to
sbo_dictionary
class objects. Currently, only a method for character
vectors is implemented, and this will be described below.
Character vector input:
Calling as_sbo_dictionary(x)
simply decorates the character
vector x
with the class sbo_dictionary
attribute,
and with customizable .preprocess
and EOS
attributes.
Valerio Gherardi