thellie
Member
Hi
I don't think I posted about this yet...
I'm building an online aid for people to learn northern Thai dialect - fairly basic, with words, sentences, some information, etc.
This is my senior project for my Thai language degree, and I've come across a web-wide problem with the sort order of Thai words. There is a set criteria in Thai book dictionaries for how to order words, which is fairly complex. But, computers don't seem to be able to replicate this fully.
What I have found on all the websites I've researched so far, which have lists of words in Thai script, is that the ordering is by the first consonant, then vowels.
In Thai most vowels sit on, to the right, or under the first consonant, but there are 5 which sit in front of it. Words beginning with these vowels are put to the end of the sort order. They should however come at the end of the relevant consonant.
What I have done, using Fabrik, is built a sort order table(s), which will sort the words correctly - essentially ensuring that the 5 vowels that come in front of the first consonant, are sorted at the end of that consonant's list.
I've got this far (I hope you have too, and are still reading), but am a bit stumped. The query below is a test to make sure I'm in the right thinking... which I am... I haven't written the final query yet, but that's not a problem.
All I want to know (I think this will complete the job) is how to get the query to run and drop the sort code into a lookup field. But I'm not sure what is the best way - calc plugin? If so, it needs to be framed in php, and I'm hoping you have an example I can look at...?
Sorry for yabbering on...
I don't think I posted about this yet...
I'm building an online aid for people to learn northern Thai dialect - fairly basic, with words, sentences, some information, etc.
This is my senior project for my Thai language degree, and I've come across a web-wide problem with the sort order of Thai words. There is a set criteria in Thai book dictionaries for how to order words, which is fairly complex. But, computers don't seem to be able to replicate this fully.
What I have found on all the websites I've researched so far, which have lists of words in Thai script, is that the ordering is by the first consonant, then vowels.
In Thai most vowels sit on, to the right, or under the first consonant, but there are 5 which sit in front of it. Words beginning with these vowels are put to the end of the sort order. They should however come at the end of the relevant consonant.
What I have done, using Fabrik, is built a sort order table(s), which will sort the words correctly - essentially ensuring that the 5 vowels that come in front of the first consonant, are sorted at the end of that consonant's list.
I've got this far (I hope you have too, and are still reading), but am a bit stumped. The query below is a test to make sure I'm in the right thinking... which I am... I haven't written the final query yet, but that's not a problem.
All I want to know (I think this will complete the job) is how to get the query to run and drop the sort code into a lookup field. But I'm not sure what is the best way - calc plugin? If so, it needs to be framed in php, and I'm hoping you have an example I can look at...?
Code:
SELECT SUBSTRING(word,1,1) AS first_character, SUBSTRING(word,2,1) AS second_character, CONCAT(SUBSTRING(word,1,1), SUBSTRING(word,2,1)) AS two_characters
FROM `vocabulary`
WHERE CONCAT(SUBSTRING(word,1,1), SUBSTRING(word,2,1)) IN (SELECT sort_it FROM sort_order_121_repeat)
AND
(SUBSTRING(word,1,1) = '?' OR
SUBSTRING(word,1,1) = '?' OR
SUBSTRING(word,1,1) = '?' OR
SUBSTRING(word,1,1) = '?' OR
SUBSTRING(word,1,1) = '?')
Sorry for yabbering on...