emacs-bidi
[Top][All Lists]
Advanced

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

Re: [emacs-bidi] debugging visual-to-logical


From: Alex Schroeder
Subject: Re: [emacs-bidi] debugging visual-to-logical
Date: Mon, 19 Nov 2001 17:48:50 +0100
User-agent: Gnus/5.090004 (Oort Gnus v0.04) Emacs/21.1 (i686-pc-linux-gnu)

Eli Zaretskii <address@hidden> writes:

> On Mon, 19 Nov 2001, Alex Schroeder wrote:
>
>> "Yair Friedman (Jerusalem)" <address@hidden> writes:
>> 
>> > What does (bidi-visual-to-logical ".02-654-3210 :SI REBMUN YM" 'R2L) eval 
>> > to?
>> 
>> Strange, it seems to be no problem at all:
>> 
>> (bidi-visual-to-logical ".02-654-3210 :SI REBMUN YM" 'R2L)
>> "MY NUMBER IS: 02-654-3210."
>
> That's a bug ;-)  The logical-to-visual transformation of this:
>
>    MY NUMBER IS: 02-654-3210.
>
> is this:
>
>    .3210-654-02 :SI REBMUN YM

Hm.

(bidi-logical-to-visual "MY NUMBER IS: 02-654-3210." 'R2L)
".02-654-3210 :SI REBMUN YM"

Do you think there is a bug when resolving the levels?

(bidi-get-mnemonics
 (bidi-get-types "MY NUMBER IS: 02-654-3210."))
(R R WS R R R R R R WS R R CS WS EN EN ET EN EN EN ET EN EN EN EN CS)

It seems straight forward to me:

(bidi-get-mnemonics
 (bidi-resolve-weak-types
  (bidi-get-types "MY NUMBER IS: 02-654-3210.") t))
(R R R R R R R R R R R R R R EN EN EN EN EN EN EN EN EN EN EN R)

Thus, the levels:

(bidi-resolve-implicit-levels
 (bidi-resolve-weak-types
  (bidi-get-types "MY NUMBER IS: 02-654-3210.") t)
 (make-list (length "MY NUMBER IS: 02-654-3210.") 1))
(1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 1)

There is no reason to assume that the number should be inverted in a
R2L context.

Since transforming Yair's string to a logical representation and back
to a visual representation yields the same string, I think that the
intermediate logical representation is valid.

(bidi-logical-to-visual
 (bidi-visual-to-logical ".02-654-3210 :SI REBMUN YM" 'R2L) 'R2L)
".02-654-3210 :SI REBMUN YM"

One of the logical representations of Yair's visual representation is
this one:

(bidi-visual-to-logical ".02-654-3210 :SI REBMUN YM" 'R2L)
"MY NUMBER IS: 02-654-3210."

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



reply via email to

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