Class: Transliterator

Transliterator(substitutions) → {function}

A Transliterator class that saves a set of transliteration rules for repeated use.

Constructor

new Transliterator(substitutions) → {function}

Create a new Transliterator

Parameters:
Name Type Description
substitutions Object

The set of substitution rules that this Transliterator should use. See the transliterate method for documentation on how this substitutions object should be formatted.

Properties:
Name Type Description
substitutions Object

The set of substitution rules for this Transliterator. You can update the substitution rules used by this Transliterator at any time by modifying this object. See the transliterate method for documentation on how this substitutions object should be formatted.

Source:
Returns:

Returns a transliterate function that accepts a string and makes the substitutions provided in the transliterate argument.

Type
function
Example
{@lang javascript}
const substitutions = {
  tʼ: `d`,
  ts: `c`,
};

const transliterate = new Transliterator(substitutions);
const input         = `tsatʼ`;
const output        = transliterate(input);
console.log(output); // --> "cad"