Suyat Translator is an open-source Javascript library for translating (transliterating) Philippine text into their corresponding indigenous scripts, known as suyat. The following scripts are supported:
Key Features
- supports both dynamic (as you type each letter) and bulk text translation modes
- uses Google Noto Fonts for wide compatiblity
- works out-of-the-box on iPhone/iPad and Android devices
- requires downloading the fonts on Windows, Mac & Linux
Suyat Translator https://www.isawika.com/translator
Suyat is an abugida (aka "alphasyllabary"), a writing system in which consonant-vowel sequences are written as a unit rather than 2 separate symbols.
The rules are simple. Put a kudlit (diacritical mark) above the base consonant symbol to represent a trailing vowel 'e' or 'i', or below to represent 'o' or 'u'. Don't put a kudlit when the trailing vowel is 'a'. Here is an example in Baybayin.
What if syllable ends with a consonant? Traditionally you would leave the base symbol unmarked. For example:
which can be read as "malay" or "malaya"
To eliminate this ambiguity, a new convention was adopted-- add a virama (ending diacritical mark) to the base consonant symbol.
Top: "malay", Bottom: "malaya"
The Hanunó'o script follows the same set of rules. The Buhid and Tagbanwa scripts did not adopt the virama convention, hence making them more challenging to read.
-
Include the library in your code
<script src="suyat.js" type="text/javascript"></script>
-
Instantiate the Suyat class
var myScript = new Suyat('hanunoo'); // or 'baybayin', 'buhid', 'tagbanwa'
-
To translate a text block
var output = translateBulk(inputText);
$(target).html(output); -
To translate letters as you type, call the computeChangeOnAdd() or computeChangeOnDelete() function. Look at editor.js for an example.
The library generates a translation by representing each suyat symbol (glyph) as a sequence of 1 or 2 Unicode characters: the base character, optionally followed by a combining diatritical mark.
For example, the Hanunó'o syllable "mi" is represented as the Unicode sequence U+172B, U+1732.
As the user types each input letter (or delete), the functions computeChangeOnAdd() or computeChangeOnDelete() determines what changes to make in the output buffer, returning this information in the form of an "edit command". The edit command specifies:
- how many Unicode characters to delete from the end of the buffer
- the new sequence of Unicode characters to add
Your application should then modify the output buffer accordingly.
The rules for formulating the edit commands are based on how you would actually write the script. Here are the rules for Modified Baybayin. These rules are implemented in the above 2 compute functions.