thaicheck

thaicheck is a tool for checking Thai text files have valid letter sequence order.

Many systems (text editors, word processors, keyboard drivers etc.) allow you to type Thai in incorrect letter sequence. When you write Thai by hand the sequence order in which you write is not important as long as the text looks correct. When you type on a computer the font renderer can have problems with "non-standard" letter order. For example, you should always type tone or diacritic markers after typing the consonants and vowels for the same character cell. Personally, many times I have typed nam (water) "nor noo - sara um - mai toh" which is incorrect, it should be "nor noo - mai toh - sara um". I made this mistake several times when I was working on the Speak Real Thai website but Firefox rendered it with no visible problems, it was only when I checked with Internet Explorer I could see the rendering was a mess.

What is standard letter order ? This has been defined by the Thai API Consortium (TAPIC) in the WTT 2.0 standard. Through this standard it is possible to make sure that text is always rendered properly and looks correct, consistently, on all systems. Additionally, a special rule for sara am has been added; this is consistent with the implementations used by Pango and Microsoft.

Run this tool over TIS-620 coded text files and it will tell you where there are any sequence errors. Use thaiconv to make sure your file is TIS-620 if you are not sure. My Thai text editor Sontana also features thaicheck code.

Features

Latest version is: 1.1

  • thaicheck is compiled on vbcc (Amiga/MorphOS) and gcc (Linux/Cygwin).
  • 3 levels of strictness, as defined by WTT 2.0.
  • Available on many platforms.
  • thaicheck code is used in Sontana and BareEd.

Download

Choose your platform:

Linux and Windows binaries are statically linked.

Instructions

Using thaicheck is straightforward, with no parameters you get some help information:


Work:Dev/ThaiCheck> thaicheck
thaicheck v1.1
Usage: thaicheck filename [level=2]
Checks Thai letter order. Lyndon Hill (c) 2007.
Strictness level: 0=passthrough, 1=basic check, 2=strict.

To check a file with strictest setting :


Work:Dev/ThaiCheck> thaicheck /Test/test-tis620.thai
Error at 2,2: Leading Vowel cannot be followed by Following Vowel 1 (211)
Error at 5,3: Leading Vowel cannot be followed by Following Vowel 1 (210)
2 errors

Some notes:

  • The location of the first column, first row is 0,0.
  • Classifications such as "Following Vowel 1" are defined in WTT.
  • The number in brackets at the end of the error shows the TIS-620 code of the character where the error was noticed. You can easily find which character in a TIS-620 chart.
  • If no mistakes are detected there will be no message.


Home