CodeEscape

CodeEscape

Handles masking of the portion of text that will be sent to the translation machine.

Constructor

new CodeEscape()

Source:

Members

originalTexts :Array.<String>

Description:
  • Original texts

Source:

Original texts

Type:
  • Array.<String>

sourceText :String

Description:
  • The initial state of the text

Source:

The initial state of the text

Type:
  • String

text :String

Description:
  • The current state of the text accross escaping steps

Source:

The current state of the text accross escaping steps

Type:
  • String

toTranslate :String|Array.<String>|undefined

Description:
  • A string or array of string ready to translate
    Undefined by default

Source:

A string or array of string ready to translate
Undefined by default

Type:
  • String | Array.<String> | undefined

Methods

afterTranslation(translations) → {TranslationResult}

Description:
  • Restore back the string and send as result

Source:
Parameters:
Name Type Description
translations String | Array.<String>

The masked translation result

Returns:
  • Translation result
Type
TranslationResult

processMatchRule(string) → {String}

Description:
  • Function to handle each of matched string

Source:
Parameters:
Name Type Description
string String

Matched string

Returns:

Replacement

Type
String