| AbbreviationPipe {bdpar} | R Documentation |
Class to find and/or replace the abbreviations on the data field of an Instance
Description
AbbreviationPipe class is responsible for detecting
the existing abbreviations in the data field of each Instance.
Identified abbreviations are stored inside the abbreviation field of
Instance class. Moreover if needed, is able to perform inline
abbreviations replacement.
Details
AbbreviationPipe class requires the resource files (in json format)
containing the correspondence between abbreviations and meaning. To this end,
the language of the text indicated in the propertyLanguageName should
be contained in the resource file name (ie. abbrev.xxx.json where xxx is the
value defined in the propertyLanguageName ). The location of the
resources should be defined in the "resources.abbreviations.path"
field of bdpar.Options variable.
Note
AbbreviationPipe will automatically invalidate the
Instance whenever the obtained data is empty.
Inherit
This class inherits from GenericPipe and implements the
pipe abstract function.
Super class
bdpar::GenericPipe -> AbbreviationPipe
Methods
Public methods
Inherited methods
Method new()
Creates a AbbreviationPipe object.
Usage
AbbreviationPipe$new(
propertyName = "abbreviation",
propertyLanguageName = "language",
alwaysBeforeDeps = list("GuessLanguagePipe"),
notAfterDeps = list(),
replaceAbbreviations = TRUE,
resourcesAbbreviationsPath = NULL
)Arguments
propertyNameA
charactervalue. Name of the property associated with theGenericPipe.propertyLanguageNameA
charactervalue. Name of the language property.alwaysBeforeDepsA
listvalue. The dependencies alwaysBefore (GenericPipesthat must be executed before this one).notAfterDepsA
listvalue. The dependencies notAfter (GenericPipesthat cannot be executed after this one).replaceAbbreviationsA
logicalvalue. Indicates if the abbreviations are replaced or not.resourcesAbbreviationsPathA
charactervalue. Path of resource files (in json format) containing the correspondence between abbreviations and meaning.
Method pipe()
Preprocesses the Instance to obtain/replace
the abbreviations. The abbreviations found in the data are added to the
list of properties of the Instance.
Usage
AbbreviationPipe$pipe(instance)
Arguments
Returns
The Instance with the modifications that have
occurred in the pipe.
Method findAbbreviation()
Checks if the abbreviation is in the data.
Usage
AbbreviationPipe$findAbbreviation(data, abbreviation)
Arguments
Returns
A logical value depending on whether the
abbreviation is in the data.
Method replaceAbbreviation()
Replaces the abbreviation in the data for the extendedAbbreviation.
Usage
AbbreviationPipe$replaceAbbreviation(abbreviation, extendedAbbreviation, data)
Arguments
Returns
The data with the abbreviations replaced.
Method getPropertyLanguageName()
Gets the name of property language.
Usage
AbbreviationPipe$getPropertyLanguageName()
Returns
Value of name of property language.
Method getResourcesAbbreviationsPath()
Gets the path of abbreviations resources.
Usage
AbbreviationPipe$getResourcesAbbreviationsPath()
Returns
Value of path of abbreviations resources.
Method setResourcesAbbreviationsPath()
Sets the path of abbreviations resources.
Usage
AbbreviationPipe$setResourcesAbbreviationsPath(path)
Arguments
pathA
charactervalue. The new value of the path of abbreviations resources.
Method clone()
The objects of this class are cloneable with this method.
Usage
AbbreviationPipe$clone(deep = FALSE)
Arguments
deepWhether to make a deep clone.
See Also
bdpar.Options, ContractionPipe,
File2Pipe, FindEmojiPipe,
FindEmoticonPipe, FindHashtagPipe,
FindUrlPipe, FindUserNamePipe,
GuessDatePipe, GuessLanguagePipe,
Instance, InterjectionPipe,
MeasureLengthPipe, GenericPipe,
ResourceHandler, SlangPipe,
StopWordPipe, StoreFileExtPipe,
TargetAssigningPipe, TeeCSVPipe,
ToLowerCasePipe