Help with Sorting Order, Please

D

D. Roshani

Hello !

I wonder if any one can help me to create a cosomize sorting order (as Macro or added small program
in c++ or c# which does this work) in a Access Database contaning one table only words encoded in
ISO-8859-1

A a B b C c D d E e É é F f G g H h I i Í í J j
1 2 3 4 5 6 7 8 9 10 11 12
Jh jh K k L l ll M m N n O o P p Q q R r rr S s
13 14 15 16 17 18 19 20 21 22 23 24
Sh sh T t U u Ú ú Ù ù V v W w X x Y y Z z
25 26 27 28 29 30 31 32 33 34

There some unique cases in this alphabet that has to be considered while sorting.

a. Letters with diacritical (é, í, ú, ù). The Unicode numbers for these letters are:

I. Lower cases: (é – [U+00E9], [&#233]), (í – [U+00ED], [&#237]), (ú – [U+00DA], [&#250]), (ù –
[U+00F9], [&#249])
II. Upper cases: (É – [U+00C9], [&#201]), (Í – [U+00CD], [&#205]), (Ú – [U+00DA], [&#218]), (Ù –
[U+00F9], [&#217])

b. Combined letters which have to be treated as on single letter like (Jh initial case), (jh,
non-initial case), (ll, only non-initial case), (rr, only non-initial case) (Sh initial case) and
(sh, non-initial case),

c. The positions of the letters are marked from 1 to 34 starts from top left to right. This will
help to sort the words according to Kurdish Unified Alphabet. The sorting system needs to consider
the rank of level of priority to place cases in a and b in correct alphabetic position.

Thank you Dilan
 
K

Karl Heinz Buchegger

D. Roshani said:
Hello !

I wonder if any one can help me to create a cosomize sorting order (as Macro or added small program
in c++ or c# which does this work) in a Access Database contaning one table only words encoded in
ISO-8859-1

[snip]

And why do you think the C++ people can help.
Your question is all about: How do I smuggle a custom comparison function into Access.
So I would start by asking the Access people on how to do that. But that's a different
newsgroup.
 
S

Stewart Gordon

D. Roshani said:
Hello !

I wonder if any one can help me to create a cosomize sorting order (as
Macro or added small program in c++ or c# which does this work) in a
Access Database contaning one table only words encoded in ISO-8859-1

A a B b C c D d E e É é F f G g H h I i Í
í J j
1 2 3 4 5 6 7 8 9 10 11 12
Jh jh K k L l ll M m N n O o P p Q q R r
rr S s
13 14 15 16 17 18 19 20 21 22 23 24
Sh sh T t U u Ú ú Ù ù V v W w X x Y y Z z
25 26 27 28 29 30 31 32 33 34

Is this supposed to be a table? If you're going to do this, please do
it in a monospaced font!
There some unique cases in this alphabet that has to be considered while
sorting.

a. Letters with diacritical (é, í, ú, ù). The Unicode numbers for
these letters are:
b. Combined letters which have to be treated as on single letter like
(Jh initial case), (jh, non-initial case), (ll, only non-initial case),
(rr, only non-initial case) (Sh initial case) and (sh, non-initial case),

Here's how I'd do it.

Define a two-dimensional array of strings or a three-dimensional array
of characters to hold the letters, something like this:

char alphabet[34][2][3] = {
{"A", "a"}, {"B", "b"},
// ...
{"Jh", "jh"}, {"K", "k"}, {"L", "l"},
{"ll", "ll"}, // no initial case form, so repeat
// lowercase form
// ...

};

Now define a comparator function similar to strcmp. Starting with the
beginning of both strings, scan your alphabet array from the end (so
that the compound letters are caught) until you find the entry that your
string begins with. If they differ, return the difference between the
letter indexes. Otherwise, move straight onto the next letter and repeat.

Now, depending on how the data you want to sort is stored, you could use
qsort or write a function to do the sorting based on your comparator
function.

HTH

Stewart.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top