Trmorph

From Apertium
Jump to navigation Jump to search

Trmorph is a GPL morphological analyser and generator for Turkish that can be compiled with HFST.

Current State

  • Number of stems: 37,300
  • Coverage: ~90.6%
corpus words coverage
SETimes 4.1M ~90.6%

Installation

$ git clone https://github.com/coltekin/TRmorph trmorph

You should have a directory now called trmorph/, switch into it, and run the following command:

$ cd trmorph/

Now switch to the apertium branch:

$ git checkout apertium

Then do:

$ FSTC=hfst make

This should build the transducer trmorph.a, now you need to turn that into a format suitable for use with hfst-proc

$ hfst-invert -i trmorph.a | hfst-fst2fst -O -o tr.automorf.hfst

If you want a generator, you can simply do:

$ hfst-fst2fst -O -i trmorph.a -o tr.autogen.hfst

Usage

You can use it, as with other HFST compatible transducers with hfst-proc:

$ echo "Römorkör, büyük tekneleri iterek veya çekerek manevra yapmalarına yardımcı olur. " | hfst-proc tr.automorf.hfst
^Römorkör/Römorkör<n>/Römorkör<n><3s>$, 
^büyük/büyük<adj>/büyük<adj><Djn_0><n>/büyük<adj><Djn_0><n><3s>$ 
^tekneleri/tekne<n><p3p>/tekne<n><p3p><3s>/tekne<n><pl><acc>/tekne<n><pl><acc><3s>/tekne<n><pl><p3s>/tekne<n><pl><p3s><3s>$ 
^iterek/it<v><cv>$ 
^veya/veya<cnjadv>/veya<cnjcoo>/veya<n>/veya<n><3s>$ 
^çekerek/çek<v><cv>/çekerek<np>/çekerek<np><3s>$ ^manevra/manevra<n>/manevra<n><3s>$ 
^yapmalarına/yap<v><D_mA><n><p3p><dat>/yap<v><D_mA><n><p3p><dat><3s>/yap<v><D_mA><n><pl><p2s><dat>/yap<v><D_mA><n><pl><p2s><dat><3s>/yap<v><D_mA><n><pl><p3s><dat>/yap<v><D_mA><n><pl><p3s><dat><3s>/yap<v><vn><p3p><dat>/yap<v><vn><p3p><dat><3s>/yap<v><vn><pl><p2s><dat>/yap<v><vn><pl><p2s><dat><3s>/yap<v><vn><pl><p3s><dat>/yap<v><vn><pl><p3s><dat><3s>$ 
^yardımcı/yardım<n><D_CI><adj>/yardım<n><D_CI><adj><Djn_0><n>/yardım<n><D_CI><adj><Djn_0><n><3s>/yardım<n><D_CI><n>/yardım<n><D_CI><n><3s>$ 
^olur/ol<v><t_aor><3s>/olur<n>/olur<n><3s>/olur<np>/olur<np><3s>$. 

Development

Update

$ git pull origin <branchname>

Switch branch

$ git checkout apertium
Switched to branch 'apertium'
Your branch is behind 'origin/apertium' by 11 commits, and can be fast-forwarded.

$ git pull origin apertium