[Top][All Lists]
[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 01:24:07 +0100 |
User-agent: |
Gnus/5.090004 (Oort Gnus v0.04) Emacs/21.1 (i686-pc-linux-gnu) |
"Eli Zaretskii" <address@hidden> writes:
"Eli Zaretskii" <address@hidden> writes:
> Please send me the code and the testing table.
Will do in another mail.
> I'd prefer to get the code you have to work on paragraphs, because
> that's by far the most frequent use it will get (I think).
Ok.
>> (when bidi-testing
>> (assert (string=
>> (bidi-reorder-string
>> "FOO is a word for FOOLS."
>> (bidi-resolve-implicit-levels
>> (bidi-resolve-weak-types
>> (bidi-get-types "FOO is a word for FOOLS."))))
>> "OOF is a word for SLOOF."))
>
> Is this a left-to-right paragraph or a right-to-left one? The result
> is correct for the former.
This should be left to right. If you have a right to left paragraph,
you need to pass an additional parameter to bidi-resolve-weak-types.
(bidi-reorder-string
"FOO is a word for FOOLS."
(bidi-resolve-implicit-levels
(bidi-resolve-weak-types
(bidi-get-types "FOO is a word for FOOLS.")
t)))
=> " OOFis a word for.SLOOF "
This is obviously wrong.
bidi-resolve-implicit-levels also takes an optional parameter, a list
of explicit levels. Somehow it still doesn't work, however.
(bidi-reorder-string
"FOO is a word for FOOLS."
(bidi-resolve-implicit-levels
(bidi-resolve-weak-types
(bidi-get-types "FOO is a word for FOOLS.")
t)
(make-list (length "FOO is a word for FOOLS.") 1)))
=> ".SLOOF rof drow a si OOF"
Some more thinking will be required.
> Note that I assumed that bidi-reorder-string performs visual to
> logical conversion, not the other way around.
Yes, I think my main problem is that I implemented logical to visual
conversion without explicit levels, and I'm not sure what needs to be
changed exactly in order to make that a visual to logical conversion.
:)
Some more thinking will be required.
Alex.
--
http://www.emacswiki.org/
- [emacs-bidi] reordering based on implicit levels, Alex Schroeder, 2001/11/10
- Re: [emacs-bidi] reordering based on implicit levels, Eli Zaretskii, 2001/11/11
- Re: [emacs-bidi] reordering based on implicit levels,
Alex Schroeder <=
- Re: [emacs-bidi] reordering based on implicit levels, Eli Zaretskii, 2001/11/12
- Re: [emacs-bidi] reordering based on implicit levels, Alex Schroeder, 2001/11/12
- Re: [emacs-bidi] reordering based on implicit levels, Alex Schroeder, 2001/11/12
- Re: [emacs-bidi] reordering based on implicit levels, Eli Zaretskii, 2001/11/13
- Re: [emacs-bidi] reordering based on implicit levels, Alex Schroeder, 2001/11/13
- Re: [emacs-bidi] reordering based on implicit levels, Eli Zaretskii, 2001/11/13
- Re: [emacs-bidi] reordering based on implicit levels, Alex Schroeder, 2001/11/12
- Re: [emacs-bidi] reordering based on implicit levels, Eli Zaretskii, 2001/11/13
- Re: [emacs-bidi] reordering based on implicit levels, Alex Schroeder, 2001/11/12
- Re: [emacs-bidi] reordering based on implicit levels, Eli Zaretskii, 2001/11/13