| FindUrlPipe {bdpar} | R Documentation |
Class to find and/or remove the URLs on the data field of an Instance
Description
This class is responsible of detecting the existing URLs in the
data field of each Instance. Identified URLs are
stored inside the URLs field of Instance class.
Moreover if required, is able to perform inline URLs removement.
Details
The regular expressions indicated in the URLPatterns
variable are used to identify URLs.
Note
FindUrlPipe 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 -> FindUrlPipe
Public fields
Methods
Public methods
Inherited methods
Method new()
Creates a FindUrlPipe object.
Usage
FindUrlPipe$new(
propertyName = "URLs",
alwaysBeforeDeps = list(),
notAfterDeps = list("FindUrlPipe"),
removeUrls = TRUE,
URLPatterns = list(self$URLPattern, self$EmailPattern),
namesURLPatterns = list("UrlPattern", "EmailPattern")
)Arguments
propertyNameA
charactervalue. Name of the property associated with theGenericPipe.alwaysBeforeDepsA
listvalue. The dependencies alwaysBefore (GenericPipesthat must be executed before this one).notAfterDepsA
listvalue. The dependencies notAfter (GenericPipesthat cannot be executed after this one).removeUrlsA
logicalvalue. Indicates if the URLs are removed.URLPatternsA
listvalue. The regex to find URLs.namesURLPatternsA
listvalue. The names of regex.propertyLanguageNameA
charactervalue. Name of the language property.
Method pipe()
Preprocesses the Instance to obtain/remove
the URLs. The URLs found in the data are added to the
list of properties of the Instance.
Usage
FindUrlPipe$pipe(instance)
Arguments
Returns
The Instance with the modifications that have
occurred in the pipe.
Method findUrl()
Finds the URLs in the data.
Usage
FindUrlPipe$findUrl(pattern, data)
Arguments
Returns
The list with URLs found.
Method removeUrl()
Removes the URL in the data.
Usage
FindUrlPipe$removeUrl(pattern, data)
Arguments
Returns
The data with URLs removed.
Method putNamesURLPattern()
Sets the names to URL patterns result.
Usage
FindUrlPipe$putNamesURLPattern(resultOfURLPatterns)
Arguments
resultOfURLPatternsA
listvalue. The list with URLs found.
Returns
The URLs found with the names of URL pattern.
Method getURLPatterns()
Gets the URL patterns.
Usage
FindUrlPipe$getURLPatterns()
Returns
Value of URL patterns.
Method setURLPatterns()
Sets the URL patterns.
Usage
FindUrlPipe$setURLPatterns(URLPatterns)
Arguments
URLPatternsA
listvalue. The new value of the URL patterns.
Method getNamesURLPatterns()
Gets the names of URLs.
Usage
FindUrlPipe$getNamesURLPatterns()
Returns
Value of names of URLs.
Method setNamesURLPatterns()
Sets the names of URLs.
Usage
FindUrlPipe$setNamesURLPatterns(namesURLPatterns)
Arguments
namesURLPatternsA
listvalue. The new value of the names of URLs.
Method clone()
The objects of this class are cloneable with this method.
Usage
FindUrlPipe$clone(deep = FALSE)
Arguments
deepWhether to make a deep clone.
See Also
AbbreviationPipe, ContractionPipe,
File2Pipe, FindEmojiPipe,
FindEmoticonPipe, FindHashtagPipe,
FindUserNamePipe, GuessDatePipe,
GuessLanguagePipe, Instance,
InterjectionPipe, MeasureLengthPipe,
GenericPipe, SlangPipe,
StopWordPipe, StoreFileExtPipe,
TargetAssigningPipe, TeeCSVPipe,
ToLowerCasePipe