SlangPipe class is responsible for detecting
the existing slangs in the data field of each Instance.
Identified slangs are stored inside the slang field of
Instance class. Moreover if needed, is able to perform inline
slangs replacement.
This class inherits from GenericPipe and implements the
pipe abstract function.
bdpar::GenericPipe -> SlangPipe
new()Creates a SlangPipe object.
SlangPipe$new(
propertyName = "langpropname",
propertyLanguageName = "language",
alwaysBeforeDeps = list("GuessLanguagePipe"),
notAfterDeps = list(),
replaceSlangs = TRUE,
resourcesSlangsPath = NULL
)propertyNameA character value. Name of the property
associated with the GenericPipe.
propertyLanguageNameA character value. Name of the
language property.
alwaysBeforeDepsA list value. The dependencies
alwaysBefore (GenericPipes that must be executed before
this one).
notAfterDepsA list value. The dependencies
notAfter (GenericPipes that cannot be executed after
this one).
replaceSlangsA logical value. Indicates if
the slangs are replaced or not.
resourcesSlangsPathA character value. Path
of resource files (in json format) containing the correspondence between
slangs and meaning.
pipe()Preprocesses the Instance to obtain/replace
the slangs. The slangs found in the data are added to the
list of properties of the Instance.
SlangPipe$pipe(instance)instanceA Instance value. The Instance
to preprocess.
The Instance with the modifications that have
occurred in the pipe.
findSlang()Checks if the slang is in the data.
SlangPipe$findSlang(data, slang)dataA character value. The text where slang
will be searched.
slangA character value. Indicates the
slang to find.
A logical value depending on whether the
slang is in the data.
replaceSlang()Replaces the slang in the data for the extendedSlang.
SlangPipe$replaceSlang(slang, extendedSlang, data)slangA character value. Indicates the
slang to replace.
extendedSlangA character value. Indicates the
string to replace for the slangs found.
dataA character value. The text where slang
will be replaced.
The data with the slangs replaced.
getPropertyLanguageName()Gets the name of property language.
SlangPipe$getPropertyLanguageName()Value of name of property language.
getResourcesSlangsPath()Gets the path of slangs resources.
SlangPipe$getResourcesSlangsPath()Value of path of slangs resources.
setResourcesSlangsPath()Sets the path of slangs resources.
SlangPipe$setResourcesSlangsPath(path)pathA character value. The new value of the path of
slangs resources.
clone()The objects of this class are cloneable with this method.
SlangPipe$clone(deep = FALSE)deepWhether to make a deep clone.
SlangPipe class requires the resource files (in json format)
containing the correspondence between slangs and meaning. To this end,
the language of the text indicated in the propertyLanguageName should
be contained in the resource file name (ie. slang.xxx.json where xxx is the
value defined in the propertyLanguageName ). The location of the
resources should be defined in the "resources.slangs.path" field of
bdpar.Options variable.
AbbreviationPipe, bdpar.Options,
ContractionPipe, File2Pipe,
FindEmojiPipe, FindEmoticonPipe,
FindHashtagPipe, FindUrlPipe,
FindUserNamePipe, GuessDatePipe,
GuessLanguagePipe, Instance,
InterjectionPipe, MeasureLengthPipe,
GenericPipe, ResourceHandler,
StopWordPipe, StoreFileExtPipe,
TargetAssigningPipe, TeeCSVPipe,
ToLowerCasePipe