[FriBidi] Visual to Logical Order

Dov Grobgeld dov.grobgeld at gmail.com
Sat Nov 14 10:47:30 PST 2015


Hi Hossein,

Currently there is no algorithm in fribidi doing visual to logical, and as
you said in general this inversion cannot be done. A first guess would be
just to do logical to visual on the visual string.

A better approch would be something similar to the following:

1. Let's call the algorithm doing L→V convertion V(s), i.e.
fribidi_log2vis() in fribidi, and v the visual string and s the logical
string.
2. Make an initial guess of the logical string s_0 = V(v).
3. While V(s_i) ≠ s: modify s_{i+1}=M(s_i) and try again.

This basically turns the problem into a problem of how to write the
modification function M(s). This may probably be done by comparing V(s) and
v and using the differences between them to move misplaces characters to
the other side of L and R boundaries.

Another idea would be to check out the algorithm in the ICU sources. Or to
ask the lead ICU author if he could provide some references to the
heuristics they used.

Regards,
Dov





On Sat, Nov 14, 2015 at 4:18 AM, Hossein Khatoonabadi <
hkhatoonabadi at pdftron.com> wrote:

> Hi / Dorood,
>
> I'm looking for a function that converts a visual context to a logical
> string using FiriBidi library.
>
> I know that there is no standard algorithm for this, and there is no
> unique answer. However, ICU has a function that approximates logical from
> visual order. I've read the FiriBidi mailing list regarding this topic
> (from couple of years ago), but there was no acceptable
> conclusion/workaround at the time.
>
> It has been years now since that discussion and I'm sure many like us are
> still looking for such a function. Does anyone have any idea?
>
>
> _______________________________________________
> fribidi mailing list
> fribidi at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/fribidi
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/fribidi/attachments/20151114/cb9454c0/attachment.html>


More information about the fribidi mailing list