El dg 24 de 07 de 2011 a les 12:21 -0400, en/na Hector Villafuerte va
escriure:
> [...]
> > Yes it is possible, but I don't know of anyone interested in doing it.
> > If you want some tips on how I'd do it, you can respond here.
> >
> > Fran
> 
> 
> 
> Yes, please :)

You can try using fake XML tags:



$ cat > /tmp/foo

<w pos="1">This</w> <w pos="2">is</w> <w pos="3">a</w> <w
pos="4">big</w> <w pos="5">house</w> <w pos="6">.</w>

$ cat /tmp/foo | apertium -d . -f html en-ca

<w pos="1">Això</w> <w pos="2">és</w> <w pos="3"></w> <w pos="4">una
casa</w> <w pos="5">gran</w> <w pos="6">.</w>

or:

$ cat /tmp/foo 
<w pos="1"/>This <w pos="2"/>is <w pos="3"/>a <w pos="4"/>big <w
pos="5"/>house <w pos="6"/>.

$ cat /tmp/foo | apertium -d . -f html en-ca
<w pos="1"/>Això <w pos="2"/>és <w pos="3"/> <w pos="4"/>una casa <w
pos="5"/>gran <w pos="6"/>.

The problem is that in some pairs, superblanks are reordered and merged,
so you might lose some info.

Another thing you could do is to insert a tag after each LU after the
tagger, e.g.

^This<prn><tn><mf><sg><#1>$ ^be<vbser><pri><p3><sg><#2>$
^a<det><ind><sg><#3>$ ^big<adj><sint><#4>$
^house<n><sg><#5>$^.<sent><#6>$

But then you would need to edit the transfer files of all the pairs to
print these out. Also, you would need to remove them before generation.

You could also try hacking the transfer to add a superblank before each
LU in addition to the existing superblanks that come in. So e.g. get it
to print out [@pos]^ every time it prints out a '^' from an LU.

Those are my ideas for now, let me know if you have any other questions.

Fran


------------------------------------------------------------------------------
Magic Quadrant for Content-Aware Data Loss Prevention
Research study explores the data loss prevention market. Includes in-depth
analysis on the changes within the DLP market, and the criteria used to
evaluate the strengths and weaknesses of these DLP solutions.
http://www.accelacomm.com/jaw/sfnl/114/51385063/
_______________________________________________
Apertium-stuff mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/apertium-stuff

Reply via email to