> X-Mailer: Evolution 3.2.2-1+b1
> Date: Sat, 13 Jul 2013 09:38:37 +0000
> From: Francis Tyers <[email protected]>
> To: apertium-stuff <[email protected]>
> Reply-To: [email protected], [email protected]
> Subject: [Apertium-stuff] idea about transfer files
>
> While we're on the subject of the transfer files and making
> changes, I had an idea the other month about making it easier
> to teach apertium transfer: make the "attributes"
> and "variables" sections optional.
>
> There are attributes defined by default -- so in the simplest
> case of reordering the section is not necessary.
>
> http://wiki.apertium.org/wiki/A_long_introduction_to_transfer_rules#Overview_of_a_transfer_file
>>
> Really, we could reduce this to:
>
> <?xml version="1.0" encoding="utf-8"?>
> <transfer>
> <section-def-cats>
> <def-cat n="some_word_category">
> <cat-item tags="mytag.*"/>
> </def-cat>
> </section-def-cats>
> <section-rules>
> <rule>
> <pattern>
> <pattern-item n="some_word_category"/>
> <pattern-item n="some_word_category"/>
> </pattern>
> <action>
> <out>
> <lu><clip pos="2" side="tl" part="whole"/></lu>
> <b pos="1"/>
> <lu><clip pos="1" side="tl" part="whole"/></lu>
> </out>
> </action>
> </rule>
> </section-rules>
> </transfer>
>
> There are several attributes defined by default (whole, tags, lem), so
> the section isn't really mandatory from a compilation/XML point of view.
>
> This way it isn't necessary to explain everything right at the
> beginning...
>
> Fran
>
>
May be this answer will be sent on the second part of August, but does
not matter.
I perfectly agree with Fran about making the variables section optional.
A lot of rules can be written without using variables in addition with
attributes informations. May be it would be possible to avoid any variable
if several lexical units were generated inside conditional statements,
but it would be a less clean way for programming.
Anyway, I think it would be better to make variables section optional
instead of being obliged to declare a unused variable when starting
writing a .t1x file.
According to making attributes section optional, I think it is less
important. It may depend on the target language, but when we write a
t1x file, we will need very early to use one tag or more of a item
into the lexical unit of another item. So, using part="whole" only
permits to write only very basical (and rather useless) rules.
I think if we make attributes section optional, why not making every
section optional. When I started writing rules for eo -> fr translation
direction, I started writing a .t1x file doing nothing just to see
what is changed just using the bidix. This file is :
<?xml version="1.0" encoding="utf-8"?>
<transfer>
<section-def-cats>
<def-cat n="quelques_catégories_de_mots">
<cat-item tags="mytag.*"/>
</def-cat>
</section-def-cats>
<section-def-attrs>
<def-attr n="quelques_caractéristiques_d_un_mot">
<attr-item tags="macaractéristique"/>
</def-attr>
</section-def-attrs>
<section-def-vars>
<def-var n="aucune_variable"/>
</section-def-vars>
<section-rules>
<rule>
<pattern>
<pattern-item n="quelques_catégories_de_mots"/>
</pattern>
<action>
</action>
</rule>
</section-rules>
</transfer>
So, for doing that, even the rules section may be optional.
I also think instead of making more optional sections, we could
make the content optional but keep section names, like this :
<?xml version="1.0" encoding="utf-8"?>
<transfer>
<section-def-cats>
</section-def-cats>
<section-def-attrs>
</section-def-attrs>
<section-def-vars>
</section-def-vars>
<section-def-macros>
</section-def-macros>
<section-rules>
</section-rules>
</transfer>
Two other stuff about .t1x files :
There should be a keyword to indicate the word category (the tag
immediately following the lemma).
If this keyword already exists, that point is not doccumented in
the wiki.
If a pos value is out of range according to the number of patterns
in the rule, the .t1x file compile normally without a message and
then apertium-transfer may crash during execution of this rule.
I think that kind of error should be controled during compilation
and no .t1x.bin should be generated or kept if there is an error
of that kind.
--------------------------------
Bernard Chardonneau (France)
Phone : [33] 1 64 90 87 04 or [33] 9 72 36 32 90
(from Sept to June except holidays)
GSM phone : [33] 6 49 95 13 95 (french scholl holidays, C zone)
Multilingual websites for my free softwares :
http://libremail.free.fr and http://libremail.tuxfamily.org
http://cyloop.tuxfamily.org (mainly translated with Apertium)
My general website (in french only)
http://bech.free.fr
------------------------------------------------------------------------------
Get your SQL database under version control now!
Version control is standard for application code, but databases havent
caught up. So what steps can you take to put your SQL databases under
version control? Why should you start doing it? Read more to find out.
http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk
_______________________________________________
Apertium-stuff mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/apertium-stuff