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.
This class inherits from GenericPipe
and implements the
pipe
abstract function.
bdpar::GenericPipe
-> FindHashtagPipe
hashtagPattern
A character
value. The regular
expression to detect hashtags.
new()
Creates a FindHashtagPipe
object.
FindHashtagPipe$new(
propertyName = "hashtag",
alwaysBeforeDeps = list(),
notAfterDeps = list(),
removeHashtags = TRUE
)
propertyName
A character
value. Name of the property
associated with the GenericPipe
.
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.
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
.
FindHashtagPipe$pipe(instance)
instance
A Instance
value. The Instance
to preprocess.
The Instance
with the modifications that have
occurred in the pipe.
findHashtag()
Finds the hashtags in the data.
FindHashtagPipe$findHashtag(data)
data
A character
value. The text to search the
hashtags.
The list
with hashtags found.
removeHashtag()
Removes the hashtags in the data.
FindHashtagPipe$removeHashtag(data)
data
A character
value. The text where hashtags
will be removed.
The data with the hashtags removed.
clone()
The objects of this class are cloneable with this method.
FindHashtagPipe$clone(deep = FALSE)
deep
Whether to make a deep clone.
The regular expression indicated in the hashtagPattern
variable is used to identify hashtags.
AbbreviationPipe
, ContractionPipe
,
File2Pipe
, FindEmojiPipe
,
FindEmoticonPipe
, FindUrlPipe
,
FindUserNamePipe
, GuessDatePipe
,
GuessLanguagePipe
, Instance
,
InterjectionPipe
, MeasureLengthPipe
,
GenericPipe
, SlangPipe
,
StopWordPipe
, StoreFileExtPipe
,
TargetAssigningPipe
, TeeCSVPipe
,
ToLowerCasePipe