emacs-bidi
[Top][All Lists]
Advanced

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

Re: [emacs-bidi] reordering based on implicit levels


From: Alex Schroeder
Subject: Re: [emacs-bidi] reordering based on implicit levels
Date: Mon, 12 Nov 2001 22:43:03 +0100
User-agent: Gnus/5.090004 (Oort Gnus v0.04) Emacs/21.1 (i686-pc-linux-gnu)

Eli Zaretskii <address@hidden> writes:

> The correct result for the above example is this:
>
>   .SLOOF is a word for OOF

Ok, I fixed a small bug in my code (I had commented out some code in
bidi-resolve-implicit-levels which I should not have).

(let ((str "FOO is a word for FOOLS."))
  (bidi-reorder-string
   str    
   (bidi-resolve-implicit-levels
    (bidi-resolve-weak-types
     (bidi-get-types str))
    (make-list (length str) 1))))

  => ".SLOOF is a word for OOF"

> (I didn't actually test this, so the period could be a problem.)

Yes, this is exactly the problem I'm having at the moment.  Consider
the following example in UAX#9:

    Memory:              car MEANS CAR.

    Resolved levels:     22211111111111

    Reverse level 2:     rac MEANS CAR.

    Reverse levels 1-2:  .RAC SNAEM car

The resolved levels seem to indicate that his is exactly the kind of
thing we are wondering about.  They assign level 1 to the final
full-stop.  Here's what my code does:

(let ((str "car MEANS CAR."))
   (bidi-resolve-implicit-levels
    (bidi-resolve-weak-types
     (bidi-get-types str))
    (make-list (length str) 1)))

  => (2 2 2 2 1 1 1 1 1 1 1 1 1 2)

The final full-stop gets a level of 2.  I will investigate some more;
it could be that the problem I am having is related to the sor/eor
assumptions I am making.

Alex.
-- 
http://www.emacswiki.org/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]