thai-language.comInternet resource
for the Thai language
Page 1 of 1

The RID fetcher

PostPosted: Sun May 11, 2014 5:48 am
by Tonkhla
I spent some free time coding a basic program which fetches a word's definitions from the RID online. They are almost identical, but the good thing is that you can easily copy the URL of the result and post it, which can't be done with the current program of the RID.

There is one major bug due to some technical issue about encoding. In some entries whose text contains a dash, for example the ราชบัณฑิต entry, the result could be incomplete. In those cases I recommend you use the original RID online.

There is no other known problem. If you find one, feel free to inform :)

The program can be reached at http://rid.tongla.in.th.

(Technicality Alert)
The program is coded in PHP and uses cURL to fetch the information. The problem is that the RID uses TIS-620 encoding but many of its entries contain a dash which is not part of the encoding, so DOMDocument has difficulty converting it to UTF-8.

I can also put the source code on GitHub if anyone's interested.

Re: The RID fetcher

PostPosted: Sun May 11, 2014 6:00 am
by David and Bui
Very nice, ต้นกล้า. I see that your "fetcher" does wild card searches, like the RID online does. You can do a wild card search by adding a * anywhere in the look-up field. Thus, looking up "มาก*" produced results: มาก, มากมาย, มากมายก่ายกอง, มากหน้าหลายตา, and มากหมอมากความ as well as their definitions.

Well done!

Copyright © 2020 thai-language.com. Portions copyright © by original authors, rights reserved, used by permission; Portions 17 USC §107.