Learn R Programming

bdpar (version 1.0.1)

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

Usage

FindEmojiPipe

Arguments

Constructor

FindEmojiPipe$new(propertyName = "emoji",
                  alwaysBeforeDeps = list(),
                  notAfterDeps = list())

  • Arguments:

    • propertyName: (character) name of the property associated with the Pipe.

    • alwaysBeforeDeps: (list) the dependences alwaysBefore (Pipes that must be executed before this one).

    • notAfterDeps: (list) the dependences notAfter (Pipes that cannot be executed after this one).

Inherit

This class inherits from PipeGeneric and implements the pipe abstract function.

Methods

  • pipe: preprocesses the Instance to obtain/replace the emojis.

    • Usage: pipe(instance, replaceEmoji = TRUE)

    • Value: the Instance with the modifications that have occurred in the Pipe.

    • Arguments:

      • instance: (Instance) Instance to preproccess.

      • replaceEmoji: (logical) indicates if the emojis are replaced.

  • findEmoji: checks for the existence of an specific emoji.

    • Usage: findEmoji(data, emoji)

    • Value: boolean, depending on whether the emoji is on the data.

    • Arguments:

      • data: (character) text to search the emoji.

      • emoji: (character) indicates the emoji to find.

  • replaceEmoji: replaces the emoji in the data for the extendedEmoji.

    • Usage: replaceEmoji(emoji, extendedEmoji, data)

    • Value: the data with emoji replaced.

    • Arguments:

      • emoji: (character) indicates the emoji to remove.

      • extendedEmoji: (character) determines the text source to replace the emoji found.

      • data: (character) text where emojis will be replaced.

Details

FindEmojiPipe use the emoji list provided by rtweet package.

See Also

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