[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freedesktop-fribidi
Subject:    Re: [FriBidi] Visual to Logical Order
From:       Dov Grobgeld <dov.grobgeld () gmail ! com>
Date:       2015-11-14 18:47:30
Message-ID: CA++fsGGeiVZAncBCyLPsKaZ5xYUE0UkR9E-DGB212Ris3o_9ow () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


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@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@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/fribidi
>
>

[Attachment #5 (text/html)]

<div dir="ltr"><div class="gmail_default" \
style="font-family:arial,helvetica,sans-serif">Hi Hossein,<br><br></div><div \
class="gmail_default" style="font-family:arial,helvetica,sans-serif">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. <br><br>A better approch would be something similar to the \
following:<br><br></div><div class="gmail_default" \
style="font-family:arial,helvetica,sans-serif">1. Let&#39;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.<br></div><div class="gmail_default" \
style="font-family:arial,helvetica,sans-serif">2. Make an initial guess of the \
logical string s_0 = V(v).<br></div><div class="gmail_default" \
style="font-family:arial,helvetica,sans-serif">3. While V(s_i) ≠ s: modify \
s_{i+1}=M(s_i) and try again.<br><br></div><div class="gmail_default" \
style="font-family:arial,helvetica,sans-serif">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. <br><br></div><div \
class="gmail_default" style="font-family:arial,helvetica,sans-serif">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.<br><br></div><div \
class="gmail_default" \
style="font-family:arial,helvetica,sans-serif">Regards,<br></div><div \
class="gmail_default" \
style="font-family:arial,helvetica,sans-serif">Dov<br></div><div \
class="gmail_default" \
style="font-family:arial,helvetica,sans-serif"><br><br></div><div \
class="gmail_default" \
style="font-family:arial,helvetica,sans-serif"><br><br></div></div><div \
class="gmail_extra"><br><div class="gmail_quote">On Sat, Nov 14, 2015 at 4:18 AM, \
Hossein Khatoonabadi <span dir="ltr">&lt;<a href="mailto:hkhatoonabadi@pdftron.com" \
target="_blank">hkhatoonabadi@pdftron.com</a>&gt;</span> wrote:<br><blockquote \
class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex"><div dir="ltr">Hi / Dorood,<div><br></div><div>I&#39;m \
looking for a function that converts a visual context to a logical string using \
FiriBidi library.  </div><div><br></div><div>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&#39;ve read the FiriBidi mailing list \
regarding this topic (from couple of years ago), but there was no acceptable \
conclusion/workaround at the time.  </div><div><br></div><div>It has been years now \
since that discussion and I&#39;m sure many like us are still looking for such a \
function. Does anyone have any idea?</div><div><br></div></div> \
<br>_______________________________________________<br> fribidi mailing list<br>
<a href="mailto:fribidi@lists.freedesktop.org">fribidi@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/fribidi" rel="noreferrer" \
target="_blank">http://lists.freedesktop.org/mailman/listinfo/fribidi</a><br> \
<br></blockquote></div><br></div>


[Attachment #6 (text/plain)]

_______________________________________________
fribidi mailing list
fribidi@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/fribidi


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic