[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [emacs-bidi] reordering based on implicit levels
From: |
Eli Zaretskii |
Subject: |
Re: [emacs-bidi] reordering based on implicit levels |
Date: |
Mon, 12 Nov 2001 11:19:57 +0200 (IST) |
On Mon, 12 Nov 2001, Alex Schroeder wrote:
> >> (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.
Okay. You should be aware, though, that by default, a logical
paragraph which begins with a strong R2L character will be displayed
as right-to-left (that's clause P1 in UAX#9).
> 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.
I think you should invert the entire string first, if the paragraph is
right-to-left. _Then_ apply your code to the inverted string.
The correct result for the above example is this:
.SLOOF is a word for OOF
(I didn't actually test this, so the period could be a problem.)
> 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.
> :)
I think, except for the inversion I mentioned, you shouldn't need
anything.
- [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, 2001/11/11
- Re: [emacs-bidi] reordering based on implicit levels,
Eli Zaretskii <=
- 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
- Re: [emacs-bidi] reordering based on implicit levels, Alex Schroeder, 2001/11/13