Helps to convert Bopomofo syllables to Braille and vice versa.

Constructors

Methods

  • Converts Bopomofo syllables to Braille.

    Parameters

    • bopomofo: string

      Bopomofo syllables in Unicode.

    Returns string

    Converted Braille in Unicode.

    BopomofoBrailleConverter.convertBpmfToBraille("ㄒㄧㄠˇㄇㄞˋㄓㄨˋㄧㄣ");
    

    It should return converted Taiwanese Braille in Unicode.

  • Converts Braille to Bopomofo syllables.

    The method calls convertBrailleToTokens to convert the input string to tokens, and then connects the tokens to form a string.

    Parameters

    • braille: string

      Braille in Unicode.

    Returns string

    Converted Bopomofo syllables in Unicode.

    BopomofoBrailleConverter.convertBrailleToBpmf("⠑⠪⠈⠍⠺⠐⠁⠌⠐⠹⠄");
    
  • Converts a Braille string to tokens. The tokens could be BopomofoSyllable objects or strings

    The method is part of the the feature to convert Braille to Chinese characters. After extracting the tokens, an application can then use a smart Bopomofo input method to convert the BopomofoSyllable objects to Chinese characters, then append the plain strings.

    Parameters

    • braille: string

      Braille in Unicode.

    Returns (string | BopomofoSyllable)[]

    Tokens. A token could be a BopomofoSyllable object or a string.

    BopomofoBrailleConverter.convertBrailleToTokens("⠑⠪⠈⠍⠺⠐⠁⠌⠐⠹⠄");