472,143 Members | 1,154 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,143 software developers and data experts.

Help with Sorting Order, Please

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

Jul 19 '05 #1
2 2957


"D. Roshani" wrote:

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.

--
Karl Heinz Buchegger
kb******@gascad.at
Jul 19 '05 #2
D. Roshani wrote:
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: <snip> 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.

--
My e-mail is valid but not my primary mailbox. Please keep replies on
on the 'group where everyone may benefit.

Jul 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by dont bother | last post: by
3 posts views Thread by John | last post: by
3 posts views Thread by Paul T. Rong | last post: by
6 posts views Thread by Dennis Gearon | last post: by
1 post views Thread by Rahul | last post: by
9 posts views Thread by Dylan Parry | last post: by
5 posts views Thread by jrod11 | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.