I began writing software to help me learn to speak Thai shortly after coming to Thailand for a visit. It had become apparent that this facinating place would be more than just a visit. I kept adding features and exercises as my skill in and understanding of the language improved. Eventually, the programs morphed into applets and I launched ThaiDrills.com.
The foundation of the site is an extensive suite of software drills that exercise the various Thai language skills: speaking, reading, and audio comprehension. The programs work hand in hand with thousands of vocabulary words and phrases painstakingly organized by topic and spoken by native Thai speakers. Beyond the software, you will also find many articles and other resources that provide a rich understanding of the Thai language in context.
This turned out to be a monumental task: Thousands upon thousands of lines of code. Then on top of that I compiled a 10,000 entry English-Thai dictionary — I literally typed every entry in both Thai and English!
Meanwhile I was supervising Thai speakers as they recorded each entry for me!
But that's not all! Although the phonetic pronunciation was generated programmatically, I first had to break each word into syllables because there is some ambiguity in this.
Why I Kept Going with this...
A couple of very interesting sub-projects — modules if you will — really hooked me. One was sound recording: I had plans to stick that module in some other apps, so I was eager to learn all about it.*
Another was the whole area of fonts and font rendering. This was actually complicated by the most interesting aspect of Thai for me...
Thai is a tonal language with some very specific rules — Get the wrong tone and you change the meaning: glai can mean near or far depending on the tone! Here are the basics for determining the tone of a syllable:
- Each syllable is composed of an initial consonant sound, a vowel sound, and optionally a final consonant.
- The 44 consonants are divided into three classes which define which "branch" you follow when figuring out the tone.
- There may or may not be one of four tone marks above the syllable which have different meanings depending on the consonant class.
- If no tone mark occurs, then the vowel and the final consonant kick in to determine the tone.
The actual rules are summarized in the chart — click it to get a more in depth treatment at the site.
That's not so bad
Well no, it's not so bad until you realize that there are no spaces between words or syllables, and you have to memorize the class of each of the 44 consonants.
It is a really helpful learning tool if the software can turn this standard written Thai:
Into this color-coded masterpiece:
Here there are spaces between the four words, and you can easily see that the first and last word have two syllables while the middle two words have only one syllable.
Furthermore, you can now see that the blue colored consonants use the rules in the third column of the chart: they are low consonants.
Then you can just whizz through the rules for each of the six syllables! Oh, by the way, you also have to know which of the 40 vowels are long, short, or irregular, and which of the consonants are live or dead at the end of each word!
There's Serious Parsing Involved!!!
If you've read this far I'm sure you realize that all of the graphics on this page are taken from screen shots of the ThaiDrills apps. To pull this off required some significant parsing. Then the rendering was another major effort.
What a great project!
*It is very insightful to record yourself while you are trading stocks and then listen to a replay with the price charts synced to the recording. It's sometimes hard to believe that an intelligent person can make such foolish errors when there is money on the line!