Alphabeticising a word list?
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
-
richmond62
- Livecode Opensource Backer

- Posts: 10246
- Joined: Fri Feb 19, 2010 10:17 am
Alphabeticising a word list?
I have an alphabet (and it really doesn't matter which one it is) that is NOT the English variant of the Latin alphabet (let's call it Ruritanian).
Now I have a load of Ruritanian texts that have been entered into a textField in Unicode-compliant Ruritanian script . . .
Now I want to take each word out of that textField (and, before you ask, word breaks are SPACES) and shove it in a listField, and then . . .
ALPHABETICISE that list according to the alphabetical order of the Ruritanian alphabet.
Obviously SORT will NOT do that.
Now I have a load of Ruritanian texts that have been entered into a textField in Unicode-compliant Ruritanian script . . .
Now I want to take each word out of that textField (and, before you ask, word breaks are SPACES) and shove it in a listField, and then . . .
ALPHABETICISE that list according to the alphabetical order of the Ruritanian alphabet.
Obviously SORT will NOT do that.
-
richmond62
- Livecode Opensource Backer

- Posts: 10246
- Joined: Fri Feb 19, 2010 10:17 am
Re: Alphabeticising a word list?
Should this work?
The problem is apparently, that richmondsOrder might prove a bit awkward as I am not convinced that:
is going to "sit nicely".
Code: Select all
sort lines of test by customSort(richmondsOrder,each)Code: Select all
put numToCodePoint(2296) & numToCodePoint(2297) & numToCodePoint(2298) into richmondsOrderRe: Alphabeticising a word list?
Please post your function "customSort"!
Maybe take a look at this:
https://lessons.livecode.com/m/2592/l/1 ... ing-a-list

Maybe take a look at this:
https://lessons.livecode.com/m/2592/l/1 ... ing-a-list
Re: Alphabeticising a word list?
Richmond.
Klaus implied what you already said, that is, you have to explicitly specify the "order" of "letters" of your alphabet. Then you can create a list of such letters that are paired with a number. Once you have that, then a custom function can sort it.
If this Martian alphabet is entirely your own, then no existing "codePoint" can help.
Craig
Klaus implied what you already said, that is, you have to explicitly specify the "order" of "letters" of your alphabet. Then you can create a list of such letters that are paired with a number. Once you have that, then a custom function can sort it.
If this Martian alphabet is entirely your own, then no existing "codePoint" can help.
Craig
Re: Alphabeticising a word list?
Maybe I misread.
Your alphabet is unicode-based? If so, what is the issue? Is the codePoint order of that alphabet not, er, ordered?
Craig
Your alphabet is unicode-based? If so, what is the issue? Is the codePoint order of that alphabet not, er, ordered?
Craig
Re: Alphabeticising a word list?
It may be as simple as "sort international" but I that is a hope, rather than expectation.
Re: Alphabeticising a word list?
Sparkout.
It sounds like the alphabet is Elbonian. I do not think they follow ordinary conventions.
Craig
It sounds like the alphabet is Elbonian. I do not think they follow ordinary conventions.
Craig
Re: Alphabeticising a word list?
I also exspected something "highly exotic", but looks like this is just a sort of custom font:
http://www.myfont.de/fonts/charmap/2275-Ruritania.html

http://www.myfont.de/fonts/charmap/2275-Ruritania.html
Re: Alphabeticising a word list?
Hmmm. I see it.
Richmond, what is your issue?
Craig
Richmond, what is your issue?
Craig
-
richmond62
- Livecode Opensource Backer

- Posts: 10246
- Joined: Fri Feb 19, 2010 10:17 am
Re: Alphabeticising a word list?
No Martian alphabets will get hurt in this exercise, but I could have listed:If this Martian alphabet is entirely your own, then no existing "codePoint" can help.
Devanagari
Grantha
Bengali
Old Bulgarian Cyrillic
Glagolitic
Gothic
Old Norse
Anglo-Saxon
Ge'ez Amharic
But was attempting some sort of shorthand by using 'Ruritanian'.
Re: Alphabeticising a word list?
That indeed will not "sit nicely".richmond62 wrote: ↑Fri Nov 21, 2025 9:09 amShould this work?
The problem is apparently, that richmondsOrder might prove a bit awkward as I am not convinced that:Code: Select all
sort lines of test by customSort(richmondsOrder,each)
is going to "sit nicely".Code: Select all
put numToCodePoint(2296) & numToCodePoint(2297) & numToCodePoint(2298) into richmondsOrder
I think either never mind the custom sort, unless there's something you need to adjust that an international sort won't chew. Or work your custom sort into a function, then call it
Code: Select all
sort lines of test by richmondsOrder(each)Code: Select all
function richmondsOrder pDataRe: Alphabeticising a word list?
I'd offer an opinion but I can't say I'm certain I understand what Richmond's ask actually is?
Sort the words?
Sort the words by more than the first char?
Sort the letters within each word?
Sort all the letters of the text into char-soup?
The question that immediately follows is why. Not being facetious, but presumably this is aid of loftier goal, that may be more effectively achieved using other means.
Perhaps if Richmond can expand what he's trying to do and what exactly he wants it might be easier to offer help...
Sort the words?
Sort the words by more than the first char?
Sort the letters within each word?
Sort all the letters of the text into char-soup?
The question that immediately follows is why. Not being facetious, but presumably this is aid of loftier goal, that may be more effectively achieved using other means.
Perhaps if Richmond can expand what he's trying to do and what exactly he wants it might be easier to offer help...
Re: Alphabeticising a word list?
Richmond.
So Ruritania is an imaginary world derived from three novels starting with "The Prisoner of Zenda".
This means the alphabet does not really exist.
But there is a published imaginary alphabet. Why not simply attach a number to each Rumanian letter, sort those pairs numeric and then strip the numbers?
Craig
So Ruritania is an imaginary world derived from three novels starting with "The Prisoner of Zenda".
This means the alphabet does not really exist.
But there is a published imaginary alphabet. Why not simply attach a number to each Rumanian letter, sort those pairs numeric and then strip the numbers?
Craig
Re: Alphabeticising a word list?
Hey, there is a Ruritainium font, and unicode contains it. For example, "A" is U+0041.
Done. You can sort away.
Craig
Done. You can sort away.
Craig
Re: Alphabeticising a word list?
Richmond,
from the dictionary entry for sort container:
So I gave it a try:
No idea what it is saying or if it is working or not. It does sort however.
Kind regards
Bernd
from the dictionary entry for sort container:
Name: sortType
Type: enum
Description:
If you don't specify a sortType, the sortType is text.
• international: sorts by collation according to the system locale
• numeric: sorts by number. (Use this form if the sortKey consists of numbers)
• datetime: treats the sortKey as a date and/or time
• text: sorts using a codepoint by codepoint comparison
• binary: sorts using a byte by byte comparison
So I gave it a try:
No idea what it is saying or if it is working or not. It does sort however.
Kind regards
Bernd
