InterjectionPipe
class is responsible for detecting
the existing interjections in the data field of each Instance
.
Identified interjections are stored inside the interjection field of
Instance
class. Moreover if needed, is able to perform inline
interjections removement.
This class inherits from GenericPipe
and implements the
pipe
abstract function.
bdpar::GenericPipe
-> InterjectionPipe
new()
Creates a InterjectionPipe
object.
InterjectionPipe$new(
propertyName = "interjection",
propertyLanguageName = "language",
alwaysBeforeDeps = list("GuessLanguagePipe"),
notAfterDeps = list(),
removeInterjections = TRUE,
resourcesInterjectionsPath = NULL
)
propertyName
A character
value. Name of the property
associated with the GenericPipe
.
propertyLanguageName
A character
value. Name of the
language property.
alwaysBeforeDeps
A list
value. The dependencies
alwaysBefore (GenericPipes
that must be executed before
this one).
notAfterDeps
A list
value. The dependencies
notAfter (GenericPipes
that cannot be executed after
this one).
removeInterjections
A logical
value. Indicates if
the interjections are removed or not.
resourcesInterjectionsPath
A character
value. Path
of resource files (in json format) containing the interjections.
pipe()
Preprocesses the Instance
to obtain/remove
the interjections. The interjections found in the data are added to the
list of properties of the Instance
.
InterjectionPipe$pipe(instance)
instance
A Instance
value. The Instance
to preprocess.
The Instance
with the modifications that have
occurred in the pipe.
findInterjection()
Checks if the interjection is in the data.
InterjectionPipe$findInterjection(data, interjection)
data
A character
value. The text where interjection
will be searched.
interjection
A character
value. Indicates the
interjection to find.
A logical
value depending on whether the
interjection is in the data.
removeInterjection()
Removes the interjection in the data.
InterjectionPipe$removeInterjection(interjection, data)
interjection
A character
value. Indicates the
interjection to remove.
data
A character
value. The text where interjection
will be removed.
The data with the interjections removed.
getPropertyLanguageName()
Gets the name of property language.
InterjectionPipe$getPropertyLanguageName()
Value of name of property language.
getResourcesInterjectionsPath()
Gets the path of interjections resources.
InterjectionPipe$getResourcesInterjectionsPath()
Value of path of interjections resources.
setResourcesInterjectionsPath()
Sets the path of interjections resources.
InterjectionPipe$setResourcesInterjectionsPath(path)
path
A character
value. The new value of the path of
interjections resources.
clone()
The objects of this class are cloneable with this method.
InterjectionPipe$clone(deep = FALSE)
deep
Whether to make a deep clone.
InterjectionPipe
class requires the resource files (in json format)
containing the list of interjections. To this end, the language of the text
indicated in the propertyLanguageName should be contained in the
resource file name (ie. interj.xxx.json where xxx is the value defined in the
propertyLanguageName ). The location of the resources should be
defined in the "resources.interjections.path" field of
bdpar.Options variable.
AbbreviationPipe
, bdpar.Options
,
ContractionPipe
, File2Pipe
,
FindEmojiPipe
, FindEmoticonPipe
,
FindHashtagPipe
, FindUrlPipe
,
FindUserNamePipe
, GuessDatePipe
,
GuessLanguagePipe
, Instance
,
MeasureLengthPipe
, GenericPipe
,
ResourceHandler
, SlangPipe
,
StopWordPipe
, StoreFileExtPipe
,
TargetAssigningPipe
, TeeCSVPipe
,
ToLowerCasePipe