[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Re: Perl impeletion of bidi



You right. It's easy then I expected it to be. But, how do I implement this? (I'm not a 
REGEX expert - can't put hands on a quick tutor - do you know one?)
For English, there is a requirement for <DIV align="left">, and for Hebrew - <Div 
align="right"><font dir=rtl> - I know, one element can be omitted, but that's doesn't 
metter.

Also, for HTML support - is there a way to ignore HTML elements at all? meaning, that if 
paragraph stars with <a href="">aaa</a>, the 'aaa' wont control the direction (in Hebrew 
paragraph follows...)

About Visual Hebrew - It's a dead body. We all need to stop support this, nowdays any 
browser support iso-8859-8-i, including Mozi and Konqi.

Thanks, You are great!

---- תחילת ההודעה המקורית ----

מאת:Tzafrir Cohen <tzafrir@technion.ac.il>
נשלח:Sun, 16 Sep 2001 11:36:47 +0300 (IDT)
אל:foo bar <foobar@hotmail.co.il>
העתק:<linux-il@linux.org.il>
נושא:Re: Perl impeletion of bidi


On Sat, 15 Sep 2001, foo bar wrote:

> I'm tring to do a form-based HTML generator with a bidi support, which
> will align the text automatically to the targeted, depending on the
> paragraph content. Now, I'm having trubles defining suitable regular
> expression, since I'm not expert with that. Has someone over here a
> perl regex for defining Hebrew?

What do you mean by "bidi support"? Visual hebrew?

I assume logical hebrew. I'm not sure I understand your question, though.

Generally the base direction of the paragraph is determained (if not
pre-determained by the context) by the first "strong" character. so an LTR
paragraph will be /[neutral chars]*[LTR chars]/ and an RTL paragraph will
be /[neutral chars]*{RTL chars]/ .

(Is there a way to tell the browser something like <p dir="neutral">  and
leave this job to the browser?)

BTW: speaking of perl and bidi, yesterday I had another look at
Lingua::IW::Logical (a module for converting logical->visual). It's
implementation is not the greatest (as admitted by the author here ;-),

However it turns out that basically all you have to do is use
FriBidi::Iso8859_8 (from the FriBidi module, http://fribidi.sf.net) and
replace Logical.pm's log2vis_string() with a wrapper that calls FriBidi's
log2vis(). Works nice.

-- 
Tzafrir Cohen
mailto:tzafrir@technion.ac.il
http://www.technion.ac.il/~tzafrir



---- סוף ההודעה המקורית ----



נשלח ע"י משתמש Hotmail בעיברית.
הצטרפו גם אתם לקהילת MSN  ישראל.
          http://www.msn.co.il

To unsubscribe, send mail to linux-il-request@linux.org.il with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail linux-il-request@linux.org.il