Learn R Programming

bdpar (version 3.1.0)

FindHashtagPipe: 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.

Arguments

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

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 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.


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

instance

A Instance value. The Instance to preprocess.

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.

Details

The regular expression indicated in the hashtagPattern variable is used to identify hashtags.

See Also

AbbreviationPipe, ContractionPipe, File2Pipe, FindEmojiPipe, FindEmoticonPipe, FindUrlPipe, FindUserNamePipe, GuessDatePipe, GuessLanguagePipe, Instance, InterjectionPipe, MeasureLengthPipe, GenericPipe, SlangPipe, StopWordPipe, StoreFileExtPipe, TargetAssigningPipe, TeeCSVPipe, ToLowerCasePipe