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.
InterjectionPipe
InterjectionPipe$new(propertyName = "interjection", propertyLanguageName = "language", alwaysBeforeDeps = list("GuessLanguagePipe"), notAfterDeps = list())
Arguments:
propertyName: (character) name of the property associated with the Pipe.
propertyLanguageName: (character) name of the language property.
alwaysBeforeDeps: (list) the dependences alwaysBefore (Pipes that must be executed before this one).
notAfterDeps: (list) the dependences notAfter (Pipes that cannot be executed after this one).
This class inherits from PipeGeneric
and implements the
pipe
abstract function.
pipe
Preprocesses the Instance
to obtain/remove the interjections.
The interjections found in the Pipe are added to the list of properties of
the Instance
. If the removeInterjections
parameter is TRUE,
the interjections in the data will be removed.
findInterjection: checks if the interjection is in the data.
Usage:
findInterjection(data, interjection)
Value: boolean, depending on whether the interjection is on the data.
Arguments:
data: (character) text where interjection will be replaced.
interjection: (character) indicate the interjection to find.
removeInterjection: removes the interjection in the data.
Usage:
removeInterjection(interjection, data)
Value: the data with interjection removed.
Arguments:
interjection: (character) indicates the interjection to remove.
data: (character) text where interjection will be removed.
getPropertyLanguageName: gets of name of property language.
Usage:
getPropertyLanguageName()
Value: value of name of property language.
getResourcesInterjectionsPath: gets of path of interjections resources.
Usage:
getResourcesInterjectionsPath()
Value: value of path of interjections resources.
setResourcesInterjectionsPath: sets the path of interjections resources.
Usage:
setResourcesInterjectionsPath(path)
Arguments:
path: (character) the new value of the path of interjections resources.
propertyLanguageName: (character) the name of property about language.
resourcesInterjectionsPath: (character) the path where are the resources.
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 defined
in the resourcesPath section of the configuration file.
[resourcesPath]
resourcesInterjectionsPath = <<resources_interjections_path>>
AbbreviationPipe
, ContractionPipe
,
File2Pipe
, FindEmojiPipe
,
FindEmoticonPipe
, FindHashtagPipe
,
FindUrlPipe
, FindUserNamePipe
,
GuessDatePipe
, GuessLanguagePipe
,
Instance
, MeasureLengthPipe
,
PipeGeneric
, ResourceHandler
,
SlangPipe
, StopWordPipe
,
StoreFileExtPipe
, TargetAssigningPipe
,
TeeCSVPipe
, ToLowerCasePipe