Re: Visual to Logical Order
Dov Grobgeld <[email protected]> Sat, 14 Nov 2015 20:47:30 +0200
| Newsgroups | gmane.comp.internationalization.fribidi |
|---|---|
| Message-ID | <CA++fsGGeiVZAncBCyLPsKaZ5xYUE0UkR9E-DGB212Ris3o_9ow@mail.gmail.com> |
--===============1257667183==
Content-Type: multipart/alternative; boundary=001a11c36b2ab6172d0524849b4a
--001a11c36b2ab6172d0524849b4a
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
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=E2=86=92V 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 =3D V(v).
3. While V(s_i) =E2=89=A0 s: modify s_{i+1}=3DM(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 <
[email protected]> 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
> [email protected]
> http://lists.freedesktop.org/mailman/listinfo/fribidi
>
>
--001a11c36b2ab6172d0524849b4a
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div class=3D"gmail_default" style=3D"font-family:arial,he=
lvetica,sans-serif">Hi Hossein,<br><br></div><div class=3D"gmail_default" s=
tyle=3D"font-family:arial,helvetica,sans-serif">Currently there is no algor=
ithm in fribidi doing visual to logical, and as you said in general this in=
version 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=3D"gmail_default" style=3D"font-f=
amily:arial,helvetica,sans-serif">1. Let's call the algorithm doing L=
=E2=86=92V convertion V(s), i.e. fribidi_log2vis() in fribidi, and v the vi=
sual string and s the logical string.<br></div><div class=3D"gmail_default"=
style=3D"font-family:arial,helvetica,sans-serif">2. Make an initial guess =
of the logical string s_0 =3D V(v).<br></div><div class=3D"gmail_default" s=
tyle=3D"font-family:arial,helvetica,sans-serif">3. While V(s_i) =E2=89=A0 s=
: modify s_{i+1}=3DM(s_i) and try again.<br><br></div><div class=3D"gmail_d=
efault" style=3D"font-family:arial,helvetica,sans-serif">This basically tur=
ns 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 differen=
ces between them to move misplaces characters to the other side of L and R =
boundaries. <br><br></div><div class=3D"gmail_default" style=3D"font-family=
:arial,helvetica,sans-serif">Another idea would be to check out the algorit=
hm in the ICU sources. Or to ask the lead ICU author if he could provide so=
me references to the heuristics they used.<br><br></div><div class=3D"gmail=
_default" style=3D"font-family:arial,helvetica,sans-serif">Regards,<br></di=
v><div class=3D"gmail_default" style=3D"font-family:arial,helvetica,sans-se=
rif">Dov<br></div><div class=3D"gmail_default" style=3D"font-family:arial,h=
elvetica,sans-serif"><br><br></div><div class=3D"gmail_default" style=3D"fo=
nt-family:arial,helvetica,sans-serif"><br><br></div></div><div class=3D"gma=
il_extra"><br><div class=3D"gmail_quote">On Sat, Nov 14, 2015 at 4:18 AM, H=
ossein Khatoonabadi <span dir=3D"ltr"><<a href=3D"mailto:hkhatoonabadi@p=
dftron.com" target=3D"_blank">[email protected]</a>></span> wrot=
e:<br><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-l=
eft:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr">Hi / Dorood,<div><br>=
</div><div>I'm looking for a function that converts a visual context to=
a logical string using FiriBidi library.=C2=A0</div><div><br></div><div>I =
know that there is no standard algorithm for this, and there is no unique a=
nswer. However, ICU has a function that approximates logical from visual or=
der. I've read the FiriBidi mailing list regarding this topic (from cou=
ple of years ago), but there was no acceptable conclusion/workaround at the=
time.=C2=A0</div><div><br></div><div>It has been years now since that disc=
ussion and I'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=3D"mailto:[email protected]">[email protected].=
org</a><br>
<a href=3D"http://lists.freedesktop.org/mailman/listinfo/fribidi" rel=3D"no=
referrer" target=3D"_blank">http://lists.freedesktop.org/mailman/listinfo/f=
ribidi</a><br>
<br></blockquote></div><br></div>
--001a11c36b2ab6172d0524849b4a--
--===============1257667183==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: base64
Content-Disposition: inline
X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KZnJpYmlkaSBt
YWlsaW5nIGxpc3QKZnJpYmlkaUBsaXN0cy5mcmVlZGVza3RvcC5vcmcKaHR0cDovL2xpc3RzLmZy
ZWVkZXNrdG9wLm9yZy9tYWlsbWFuL2xpc3RpbmZvL2ZyaWJpZGkK
--===============1257667183==--