Concerning the hyphen confusion in BiDi (was: Re: Bidirectional Bugs in Hebrew)



I would like to offer a fresh point of view on the problem of hyphen/minus
sign between Hebrew letter and the number following it.

Conceptually, there are three text orderings:
1. The sequence of characters, as they are typed by an user on a text
   editor.
2. The sequence of characters, as stored in a file in "Logical Hebrew
   order".
3. The sequence of characters, as displayed visually - in "Visual Hebrew
   order".

In all discussions so far, we made the implicit assumption that (1)==(2).
Then we used the Unicode BiDi algorithm to convert from (1),(2) into (3)
and cursed why the user has to suffer the agony of typing first an Hebrew
letter, then a number and only then the separating hyphen if he wants to
see letter-hyphen-number sequence.

I believe that it is OK to store such a sequence as letter-number-hyphen
in a Logical Hebrew ordered text file.  Such a sequence would be displayed
(by Pango and other applications using the BiDi algorithms) as
letter-hyphen-number (from right to left).

!!! However, it does not follow from the above that the user must type !!!
!!! the sequence in the same order as in the file.                     !!!

So, I am hereby proposing that editors, which support BiDi text editing,
adopt the following rule: 

All typed-in text will be saved into text file in the same order it was
typed in (unless modified by insertions/deletions/cursor movements, of
course) EXCEPT that:
In Hebrew keyboard mode, a sequence of Hebrew letter followed by hyphen
followed by digit shall cause the following:

  The text, as stored into the file, will be in order:  Hebrew letter
  followed by digit followed by hyphen.  Then the cursor will be moved one
  position backwards, to allow insertion of additional digits before the
  hyphen.  Then, any inserted non-digit character shall cause the cursor
  to be moved after the hyphen, and then insert the non-digit character
  there.

If an user wants to override the above behavior (e.g. to enter negative
numbers), he should set the keyboard mode to Latin before typing the
hyphen, and back to Hebrew after finishing to type the number.

DISCLAIMER:  I didn't actually test the above suggestion, so it may yet
             have some flaws.  Please review it.
             I plan to test the suggestion in a BiDi text editor developed
             by me within few days - after you suggest enough test cases
             to prove that there are no flaws in my suggestion.

                                             --- Omer
WARNING TO SPAMMERS:  see at http://www.zak.co.il/spamwarning.html





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]