FindEmojiPipe: Class to find and/or replace the emoji on the data field of...

FindEmojiPipeR Documentation

Class to find and/or replace the emoji on the data field of an Instance

Description

This class is responsible of detecting the existing emojis in the data field of each Instance. Identified emojis are stored inside the emoji field of Instance class. Moreover if required, is able to perform inline emoji replacement.

Details

FindEmojiPipe use the emoji list provided by data(emojisData).

Note

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

Methods

Public methods

Inherited methods

Method new()

Creates a FindEmojiPipe object.

Usage
FindEmojiPipe$new(
  propertyName = "Emojis",
  alwaysBeforeDeps = list(),
  notAfterDeps = list(),
  replaceEmojis = 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).

replaceEmojis

A logical value. Indicates if the emojis are replaced.

propertyLanguageName

A character value. Name of the language property.


Method pipe()

Preprocesses the Instance to obtain/replace the emojis. The emojis found in the data are added to the list of properties of the Instance.

Usage
FindEmojiPipe$pipe(instance)
Arguments
instance

A Instance value. The Instance to preprocess.

Returns

The Instance with the modifications that have occurred in the pipe.


Method findEmoji()

Checks if the emoji is in the data.

Usage
FindEmojiPipe$findEmoji(data, emoji)
Arguments
data

A character value. The text where emoji will be searched.

emoji

A character value. Indicates the emoji to find.

Returns

A logical value depending on whether the emoji is in the data.


Method replaceEmoji()

Replaces the emoji in the data for the extendedEmoji.

Usage
FindEmojiPipe$replaceEmoji(emoji, extendedEmoji, data)
Arguments
emoji

A character value. Indicates the emoji to replace.

extendedEmoji

A character value. Indicates the string to replace for the emojis found.

data

A character value. The text where emoji will be replaced.

Returns

The data with the emojis replaced.


Method clone()

The objects of this class are cloneable with this method.

Usage
FindEmojiPipe$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

See Also

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


bdpar documentation built on Aug. 22, 2022, 5:08 p.m.