Apertium has moved from SourceForge to GitHub.
If you have any questions, please come and talk to us on #apertium on irc.freenode.net or contact the GitHub migration team.

Speling tools

From Apertium
(Difference between revisions)
Jump to: navigation, search
(GitHub migration)
 
(2 intermediate revisions by one user not shown)
Line 1: Line 1:
  +
{{Github-unmigrated-tool}}
 
The '''Speling tools''' are a number of scripts and programs which process [[Speling format]] files, they consist of:
 
The '''Speling tools''' are a number of scripts and programs which process [[Speling format]] files, they consist of:
   
Line 5: Line 6:
 
* <code>paradigm-chopper.py</code> -- To merge identical paradigms.
 
* <code>paradigm-chopper.py</code> -- To merge identical paradigms.
   
And can be found in [[Apertium SVN]] under <code>trunk/apertium-tools/speling</code>.
+
And can be found in [https://svn.code.sf.net/p/apertium/svn SVN] under <code>trunk/apertium-tools/speling</code>.
  +
  +
==Example usage==
  +
  +
<pre>
  +
$ cat /tmp/test
  +
house ; house ; sg ; n
  +
house ; houses ; pl ; n
  +
cat ; cat ; sg ; n
  +
cat ; cats ; pl ; n
  +
wolf ; wolf ; sg ; n
  +
wolf ; wolves ; pl ; n
  +
  +
$ python3 speling-paradigms.py /tmp/test >/tmp/test.dix
  +
house
  +
wol
  +
cat
  +
  +
$ python3 paradigm-chopperFast.py /tmp/test.dix > /tmp/test2.dix
  +
  +
$ cat /tmp/test2.dix
  +
<dictionary>
  +
<pardefs>
  +
<pardef n="wol/f__n">
  +
<e><p> <l>f</l><r>f<s n="n"/><s n="sg"/></r></p></e>
  +
<e><p> <l>ves</l><r>f<s n="n"/><s n="pl"/></r></p></e>
  +
</pardef>
  +
<pardef n="cat__n">
  +
<e><p><l/><r><s n="n"/><s n="sg"/></r></p></e>
  +
<e><p> <l>s</l><r><s n="n"/><s n="pl"/></r></p></e>
  +
</pardef>
  +
</pardefs>
  +
<section id="main" type="standard">
  +
<e lm="house"><i>house</i><par n="cat__n"/></e>
  +
<e lm="wolf"><i>wol</i><par n="wol/f__n"/></e>
  +
<e lm="cat"><i>cat</i><par n="cat__n"/></e>
  +
  +
</section>
  +
</dictionary>
  +
  +
</pre>
   
 
==See also==
 
==See also==
   
 
* [[Paradigm chopper]]
 
* [[Paradigm chopper]]
  +
  +
==External link==
  +
  +
* [https://svn.code.sf.net/p/apertium/svn/trunk/apertium-tools/speling Tools in SVN]
  +
   
 
[[Category:Tools]]
 
[[Category:Tools]]

Latest revision as of 03:35, 10 March 2018

Note: After Apertium's migration to GitHub, this tool is read-only on the SourceForge repository and does not exist on GitHub. If you are interested in migrating this tool to GitHub, see Migrating tools to GitHub.

The Speling tools are a number of scripts and programs which process Speling format files, they consist of:

  • split-speling.py -- To split a full-form list into manageable chunks for paradigm chopper
  • speling-paradigms.py -- To generate all possible paradigms for a given full-form list
  • paradigm-chopper.py -- To merge identical paradigms.

And can be found in SVN under trunk/apertium-tools/speling.

[edit] Example usage

$ cat /tmp/test 
house ; house ; sg ; n
house ; houses ; pl ; n
cat ; cat ; sg ; n
cat ; cats ; pl ; n
wolf ; wolf ; sg ; n
wolf ; wolves ; pl ; n

$ python3 speling-paradigms.py /tmp/test >/tmp/test.dix
house
wol
cat

$ python3 paradigm-chopperFast.py /tmp/test.dix > /tmp/test2.dix

$ cat /tmp/test2.dix 
<dictionary>
  <pardefs>
    <pardef n="wol/f__n">
      <e><p>          <l>f</l><r>f<s n="n"/><s n="sg"/></r></p></e>
      <e><p>          <l>ves</l><r>f<s n="n"/><s n="pl"/></r></p></e>
    </pardef>
    <pardef n="cat__n">
      <e><p><l/><r><s n="n"/><s n="sg"/></r></p></e>
      <e><p>          <l>s</l><r><s n="n"/><s n="pl"/></r></p></e>
    </pardef>
  </pardefs>
  <section id="main" type="standard">
    <e lm="house"><i>house</i><par n="cat__n"/></e>
    <e lm="wolf"><i>wol</i><par n="wol/f__n"/></e>
    <e lm="cat"><i>cat</i><par n="cat__n"/></e>

  </section>
</dictionary>

[edit] See also

[edit] External link

Personal tools