• Welcome to Jose's Read Only Forum 2023.
 

Array Sort for Unicode polytonic Greek

Started by Ron Maxwell, December 11, 2011, 04:54:42 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Ron Maxwell

I am new to using Unicode.  I am in the middle of a personal project to parse and sort Greek New Testament text to create a Lexicon.  Biblical Greek and ancient Greek are different from modern Greek in that modern Greek has only one accent mark (acute like Spanish) whereas ancient Greek has three different accent marks.  The Array Sort function in PowerBASIC seems to be designed for use of ASCII characters rather than Unicode.  Does anyone have experience sorting text of the type I am referring to?  (If someone wants to tinker with it, let me know, and I can supply a sample Unicode text file.)  Thanx, Ron

PS: I am reposting this, as I first put it on the general discussion board.  Sorry, I'm new . . . . .

Bob Zale

Hi Ron--

I see you haven't gotten any responses here, so...    It might be best to post PowerBASIC Tech Support questions on the PowerBASIC Forums at www.powerbasic.com  Another alternative would be to email your question to support@powerbasic.com  Email tech support is free for life.

Best regards,

Bob Zale
PowerBASIC Inc.

Ron Maxwell

Bob, thanx!  I hope I have put it in the right place.  Ron

Theo Gottwald

QuoteEmail tech support is free for life.

PB is really unique!

I can confirm that for many years from now i have always made only the best experinces with PB support.

Marc Chauviere

Hi Ron,
Array Sort statement (and Collate option) on strings is well designed for ANSI (single byte) strings array, thanks to PB team.

To support multi-language and Unicode, we must use Wide (double byte) strings such as WString or WStringZ*nn. As sorting is a byte-by-byte comparison, the result may be incorrect if you use various characters from different Unicode blocks.

We can still use Array Sort but implemented with a custom function (see PBWin help).

Dim tbNames(1 To 100) as WStringZ*256
...
Array Sort tbNames(), Call MyFunc()
...
Function MyFunc(Para1 As WStringZ, Para2 As WStringZ) As Long
  If Para1 < Para2 Then Function = -1 : Exit Function
  If Para1 > Para2 Then Function = +1 : Exit Function
End Function

As it seems that comparisons between wide strings are correct.
Hope this help.