[liblouis-liblouisxml] Re: Language to table Feature in liblouis is Ready.

Hi John

"John J. Boyer" <john.boyer@xxxxxxxxxxxxxxxxx> writes:

> Implementation of the language to table feature in liblouis has been 
> completed. It works with the liblouis tools and should also work with 
> xml2brl. These changes are only in svn for now.

Sorry I'm a bit late to this game, but I'm not sure this covers the
requirements I had in mind. Basically the xml file determines the
language of the text I would like to read (e.g. 'en', 'en-US', etc
according to http://en.wikipedia.org/wiki/IETF_language_tag). Then we as
a producing agency produce Braille for this given text with a set of
user preferences, i.e. Jane is a beginner Braillist and would like to
read everything uncontracted while Alice understands all the worlds
contraction rules and would like all the languages contracted. Bob
however is proficient at English contraction and understands other
languages but not their contraction rules, so he'd like all non-English
texts uncontracted. Given this we have the following preferences for
Jane, Alice and Bob:

Jane: all the languages uncontracted
Alice: All languages contracted
Bob: en in grade 2, all other languages uncontracted

If we translate to the "accept-language" syntax that I proposed before
this would result in the following:

Jane: *;en-us-g0.utb
Alice: *;en-us-g2.ctb
Bob: en;en-us-g2.ctb,*;en-us-g0.utb

The "accept-language" syntax consists of at least one tuple
language;table separated by commas. Each tuple specifies a language and
the table that is to be used for it. A wildcard '*' specifies any
language and is a catch-all. A language code 'en' would also match
'en-US', 'en-GB', etc. For that reason the order is significant as you
might want to specify a different table for texts in en-US than for
other English for example.

In the end this would translate into a new command line option that can
be passed to xml2brl namely '--accept-table' which specify the
preferences of the user. I think this should cover all the requirements
that I envision with language handling (i.e. proper handling of xml:lang
tags).

From that perspective I don't know if the lang2table offers anything
(for my use case). We might be able to do something along the lines of
what I described above with the lang2table but I'm not sure.

I was thinking that lang2table might be useful for people like NVDA but
they might want to have a mapping from (language, grade) to table, i.e.
f(language, grade) -> table. From what I can tell lang2table doesn't
offer that.

Also I think the table preference is really a user setting, so this
should be in a user specific configuration file, not in a system wide
one that is installed alongside with the tables.

> If you use the shorthand, preceded by an equals sign in place of a
> table name this file is searched.

This feels a bit hackish. I'd prefer a separate setting.

> The instructions for creating a new Makefile.am need changing to include 
> lang2table. I do not feel comfortable changing them.

I can do that if you wish.

I hope this is not too much rain on your parade, sorry.

Thanks
Christian
-- 
Christian Egli
Swiss Library for the Blind, Visually Impaired and Print Disabled
Grubenstrasse 12, CH-8045 Zürich, Switzerland
For a description of the software and to download it go to
http://www.jjb-software.com

Other related posts: