Description Usage Arguments Format Details Inherit Methods Private fields See Also
This class allows you to preprocess the data of an instance to find the abbreviations that are in it. Optionally, you can decide whether to replace the data abbreviations or not.
1 2 3 4 | AbbreviationPipe$new(propertyName = "abbreviation",
propertyLanguageName = "language",
alwaysBeforeDeps = list("GuessLanguagePipe"),
notAfterDeps = list())
|
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). |
An object of class R6ClassGenerator
of length 24.
This class needs files in json format that will contain the abbreviations to be located and the string that will replace them. For this, it is necessary that the instance contains a property that indicates the language of the data to be able to correctly choose the list of abbreviations that apply to the data. The format of the file names of the resources has to be: abbrev.xxx.json (Being xxx the value of the language property of the instance).
To indicate the path where the associated resources are located, the configuration file is used. It is necessary to indicate in the section called resourcesPath, the path of resourcesAbbreviationsPath.
The pipe will invalidate the instance in the moment that the resulting data is empty.
This class inherits from PipeGeneric
and implements the
pipe
abstract function.
pipe Function that preprocesses the instance to obtain/replace the abbreviations. The abbreviations found in the pipe are added to the list of properties of the Instance. If the replaceAbbreviations parameter is TRUE, the instance data will be modified by replacing the abbreviations found.
Usage
pipe(instance, replaceAbbreviations = TRUE)
Value
The instance with the modifications that have occurred in the pipe.
Arguments
instance (Instance) Instance to preproccess.
replaceAbbreviations (logical) Indicate if the abbreviations are replaced or not.
findAbbreviation Function that checks if the abbreviation is in the data.
Usage
findAbbreviation(data, abbreviation)
Value
TRUE or FALSE depending on whether the abbreviation is in the data.
Arguments
data (character) Text in which the abbreviation is searched.
abbreviation (character) Indicates the abbreviation to find.
replaceAbbreviation Function that replace the abbreviation in the data for the extendedAbbreviation.
Usage
replaceAbbreviation(abbreviation, extendedAbbreviation, data)
Value
The data with the abbreviatons replaced.
Arguments
abbreviation (character) Indicates the abbreviation to replace.
extendedAbbreviation (character) Indicates the string to replace for the abbreviations found.
data (character) Text in which abbreviations will be replaced.
getPropertyLanguageName Getter of name of property language.
Usage
getPropertyLanguageName()
Value
Value of name of property language.
getResourcesAbbreviationsPath Getter of path of abbreviations resources.
Usage
getResourcesAbbreviationsPath()
Value
Value of path of abbreviations resources.
propertyLanguageName (character) The name of property about language.
resourcesAbbreviationsPath (character) The path where are the resources.
PipeGeneric
, Instance
,
ResourceHandler
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.