2010/7/29 Francis Tyers <[email protected]>:
> El dc 28 de 07 de 2010 a les 16:54 +0200, en/na Kevin Brubeck Unhammer
> va escriure:
>> Hi,
>>
>> I tried making a post-generation dictionary with just one rule
>>
>>
>> <?xml version="1.0" encoding="iso-8859-1"?>
>> <dictionary>
>> <alphabet/>
>> <sdefs>
>> <sdef n="test"/>
>> </sdefs>
>> <section id="main" type="standard">
>> <e>
>> <p>
>> <l><a/>e</l>
>> <r>e</r>
>> </p>
>> </e>
>> </section>
>> </dictionary>
>>
>>
>> but I get slashed output when I try running it:
>>
>>
>> $ echo '~el' | lt-proc -p foo.autopgen.bin
>> e\/el
>>
>>
>> is this a bug or am I missing something?
>
> The problem is you need more than one character (for some reason), so
> for example this dictionary would work:
>
> <?xml version="1.0" encoding="iso-8859-1"?>
> <dictionary>
> <alphabet/>
> <sdefs>
> <sdef n="test"/>
> </sdefs>
> <pardefs>
> <pardef n="alphabet">
> <e><p><l>l</l><r>l</r></p></e>
> </pardef>
> </pardefs>
> <section id="main" type="standard">
> <e>
> <p>
> <l><a/>el</l>
> <r>e</r>
> </p>
> <par n="alphabet"/>
> </e>
> </section>
> </dictionary>
>
> $ echo "~ell" | lt-proc -p /tmp/foo.bin
> el
OK so the workaround if you want to match a single character is using
<re>.</re>:
<?xml version="1.0" encoding="iso-8859-1"?>
<dictionary>
<alphabet/>
<sdefs>
<sdef n="foo"/>
</sdefs>
<section id="main" type="standard">
<e>
<p>
<l><a/>e</l>
<r>e</r>
</p>
<re>.</re>
</e>
</section>
</dictionary>
$ lt-comp lr foo.dix foo.bin
m...@standard 4 3
$ echo '~e' | lt-proc -p foo.bin
e
--
Kevin Brubeck Unhammer
------------------------------------------------------------------------------
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://p.sf.net/sfu/dev2dev-palm
_______________________________________________
Apertium-stuff mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/apertium-stuff