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
hashtagPattern
A
character
value. 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
propertyName
A
character
value. Name of the property associated with theGenericPipe
.alwaysBeforeDeps
A
list
value. The dependencies alwaysBefore (GenericPipes
that must be executed before this one).notAfterDeps
A
list
value. The dependencies notAfter (GenericPipes
that cannot be executed after this one).removeHashtags
A
logical
value. Indicates if the hashtags are removed.propertyLanguageName
A
character
value. 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
data
A
character
value. 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
data
A
character
value. 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
deep
Whether 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