Hi all, I do not mean to be impolite, but how many times do I have to repeat? What one sees when using qwordtrans is a hebrew piece of text, with some english and some punctuation, that goes through this: 1. The original was visual. 2. It was then _reversed_, and encoded into the babylon file. 3. I _decoded_ the file (doing the last 10% of the job - the rest was already in the retroactively named libbab). So now it's _reverse_ _visual_ hebrew. 4. Now, the specific widget of QT does on it the fribidi log2vis algorithm.
Theoretically, there is no logic in this algorithm. The output should be completely unordered. However, for _trivial_ cases (e.g. Hebrew _only_ text), the bidi log2vis is simply a _reverse_. However, for anything more complicated, it's not at all the same, as everyone sees. The solution, as it seems to me, is to write a function, which will be called vis2log, and that will compute the exact opposite of log2vis. As I already said before, I have intentions to write such a function, but it's a non-trivial task, and I can't tell when it will be ready. So, if someone wishes to write it, that's the way. However, if all one wants is an English->Hebrew dictionary (that's what I wanted, and the sole reason I spent the time to make it work), then the simpler way is to run wordtrans, not [qk]wordtrans, inside an xterm with a hebrew font, and pipe it's output through a trivial reverse. I, personally, am very pleased with this solution; I configured my window manager to open such an xterm when I press some key combination, that inside, copies the "selection", and runs wordtrans, pipes, whatever, pipes to less, and that's it. For me, better than the real babylon and [qk]wordtrans, even after the Hebrew will work perfectly inside them. Didi On Sat, Dec 01, 2001 at 05:01:24PM +0100, Ricardo Villalba wrote: > El Wed, 21 Nov 2001 21:52:39 +0200, Sagi Bashari <[EMAIL PROTECTED]> > escribió: > > > Hi > > > > On Wednesday 21 November 2001 19:46, Ricardo Villalba wrote: > > > As I said before I attach the test program I used. It simply creates a > > > widget and display an hebrew text (the same I used in the pictures I > sent > > > in my previous message). So people who have Qt installed can compile > it > > > and "play" a little with it. > > > I tried several widgets: QTextBrowser, QLabel and QTextEdit. The > result is > > > the same in all of them, but I discovered an interesting thing: > resizing > > > the window change the order of the words (acording to the number of > lines > > > displayed)! > > > > > > Also I think using an edit widget is very interesting as you can edit > the > > > text and see who the words are reordered. > > > > Tested with QT3 beta5. It looks good with the ISO-8859-8 encoding. > > > > The english part - "UNIX" is reversed, but thats just because it was > already > > reversed in the source file. > > > > The words order is right too, but in some cases when the window is too > small > > it looks like the last letter (shin) gets into the UNIX part (UNI shin > X). > > Only just one last thing. I also realized that parenthesis are not well > displayed sometimes when using Qt 3. > > Example: > When I look for word "cat" I get this when using Qt 2 (the "x" means > hebrew letters): > > (xxxx) xxxxx; xxxx xxxx > > But with Qt 3 I get: > > xxxx( xxxxx ;xxxx xxxx( > > (Words and letters seems to be correctly ordered, only the parenthesis > change). > > Parethesis are quite often in the hebrew definitions, so I think this > could be an important problem. > Could it be a bug in Qt 3? > > -- > Ricardo Villalba > [EMAIL PROTECTED] ================================================================= To unsubscribe, send mail to [EMAIL PROTECTED] with the word "unsubscribe" in the message body, e.g., run the command echo unsubscribe | mail [EMAIL PROTECTED]