Difference between revisions of "Voikkospell"

From Apertium
Jump to navigation Jump to search
Line 50: Line 50:
 
=====One Tag=====
 
=====One Tag=====
 
<pre>
 
<pre>
$ echo '^c/c<A>$ | voikkospell --apertium-stream
+
$ echo '^b/b<A>$ | voikkospell --apertium-stream
W: c
+
W: b
 
</pre>
 
</pre>
   
 
=====More Than One Tag=====
 
=====More Than One Tag=====
 
<pre>
 
<pre>
$ echo '^d/d<B><C>$' | voikkospell --apertium-stream
+
$ echo '^c/c<B><C>$' | voikkospell --apertium-stream
W: d
+
W: c
 
</pre>
 
</pre>
   
 
====Ambiguous Word====
 
====Ambiguous Word====
 
<pre>
 
<pre>
$ echo '^e/e<D>/e<E>/e<D><Z>/e<D><Y>$' | voikkospell --apertium-stream
+
$ echo '^d/d<D>/d<E><F>$' | voikkospell --apertium-stream
W: e
+
W: d
 
</pre>
 
</pre>
   
Line 69: Line 69:
 
=====One Analysis=====
 
=====One Analysis=====
 
<pre>
 
<pre>
$ echo '^fg/f<F>+g<G>$' | voikkospell --apertium-stream
+
$ echo '^ef/e<G>+f<H><I>$' | voikkospell --apertium-stream
W: fg
+
W: ef
 
</pre>
 
</pre>
   
 
=====More Than One Analysis=====
 
=====More Than One Analysis=====
 
<pre>
 
<pre>
$ echo '^hi/h<H>+i<I>/h<J>+i<K>/h<H><X>+i<I>/h<H><W>+i<I><V>$' | \
+
$ echo '^gh/g<J>+h<K><L>/g<M>+h<N><O>$' | voikkospell --apertium-stream
 
W: gh
voikkospell --apertium-stream
 
W: hi
 
 
</pre>
 
</pre>
   

Revision as of 11:57, 15 December 2015

Installation

m5w/corevoikko, a fork of corevoikko, supports apertium stream format.

To clone it, execute the following command:

git clone https://github.com/m5w/corevoikko.git corevoikko

First, install libvoikko's dependencies. Next, execute the following commands:

cd corevoikko/libvoikko
./configure
make
sudo make install

If you do not have root privileges or would like to specify where to install libvoikko, execute the following instead: (Otherwise, you are finished with installation.)

cd corevoikko/libvoikko
PREFIX="$HOME/install/corevoikko" # e.g.
./configure --prefix="$PREFIX"
make
make install

Finally, add your "$PREFIX" to your "$PATH" by appending the following lines to your .profile:

PREFIX="$HOME/install/corevoikko" # e.g.
if [ -d "$PREFIX" ]; then
        export PATH="$PREFIX/bin:$PATH"
fi

Using voikkospell with apertium Stream Format

Invoke voikkospell with --apertium-stream.

Unlike in normal voikkospell usage, each word does not need to be on its own line.

Examples

Unanalysed Word

$ echo '^a/*a$'
W: a

Analysed Words

One Tag
$ echo '^b/b<A>$ | voikkospell --apertium-stream
W: b
More Than One Tag
$ echo '^c/c<B><C>$' | voikkospell --apertium-stream
W: c

Ambiguous Word

$ echo '^d/d<D>/d<E><F>$' | voikkospell --apertium-stream
W: d

Multiwords

One Analysis
$ echo '^ef/e<G>+f<H><I>$' | voikkospell --apertium-stream
W: ef
More Than One Analysis
$ echo '^gh/g<J>+h<K><L>/g<M>+h<N><O>$' | voikkospell --apertium-stream
W: gh