| FindHashtagPipe {bdpar} | R Documentation |
Class to find and/or remove the hashtags on the data field of an Instance
Description
This class is responsible of detecting the existing hashtags in the
data field of each Instance. Identified hashtags are
stored inside the hashtag field of Instance class.
Moreover if required, is able to perform inline hashtag removement.
Details
The regular expression indicated in the hashtagPattern
variable is used to identify hashtags.
Note
FindHashtagPipe 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 -> FindHashtagPipe
Public fields
hashtagPatternA
charactervalue. The regular expression to detect hashtags.
Methods
Public methods
Inherited methods
Method new()
Creates a FindHashtagPipe object.
Usage
FindHashtagPipe$new( propertyName = "hashtag", alwaysBeforeDeps = list(), notAfterDeps = list(), removeHashtags = TRUE )
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).removeHashtagsA
logicalvalue. Indicates if the hashtags are removed.propertyLanguageNameA
charactervalue. Name of the language property.
Method pipe()
Preprocesses the Instance to obtain/remove
the hashtags. The hashtags found in the data are added to the
list of properties of the Instance.
Usage
FindHashtagPipe$pipe(instance)
Arguments
Returns
The Instance with the modifications that have
occurred in the pipe.
Method findHashtag()
Finds the hashtags in the data.
Usage
FindHashtagPipe$findHashtag(data)
Arguments
dataA
charactervalue. The text to search the hashtags.
Returns
The list with hashtags found.
Method removeHashtag()
Removes the hashtags in the data.
Usage
FindHashtagPipe$removeHashtag(data)
Arguments
dataA
charactervalue. The text where hashtags will be removed.
Returns
The data with the hashtags removed.
Method clone()
The objects of this class are cloneable with this method.
Usage
FindHashtagPipe$clone(deep = FALSE)
Arguments
deepWhether to make a deep clone.
See Also
AbbreviationPipe, ContractionPipe,
File2Pipe, FindEmojiPipe,
FindEmoticonPipe, FindUrlPipe,
FindUserNamePipe, GuessDatePipe,
GuessLanguagePipe, Instance,
InterjectionPipe, MeasureLengthPipe,
GenericPipe, SlangPipe,
StopWordPipe, StoreFileExtPipe,
TargetAssigningPipe, TeeCSVPipe,
ToLowerCasePipe