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

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


=================================================================
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