Skip to content
Mika Hämäläinen edited this page Sep 1, 2017 · 10 revisions

Syntax maker

A tool for generating Finnish.

Requirements

  1. This tool requires Omorfi, you can download the correct binary version from http://mikakalevi.com/omorfi
  2. HFST pip install hfst for more instructions, see my post about HFST and Python.

Installing

You do pip install syntaxmaker to install this library. After installing it, go to Creating a sentence, the basics for a quick start guide.

libhfst.NotTransducerStreamException

>>> from syntaxmaker.syntax_maker import *

Traceback (most recent call last):¨ File "", line 1, in File "syntaxmaker/syntax_maker.py", line 3, in from phrase import Phrase File "syntaxmaker/phrase.py", line 2, in from head import Head File "syntaxmaker/head.py", line 1, in import inflector File "syntaxmaker/inflector.py", line 16, in input_stream = hfst.HfstInputStream(generation_set) File "/home/mika/.local/lib/python2.7/site-packages/libhfst.py", line 4369, in init this = _libhfst.new_HfstInputStream(*args) libhfst.NotTransducerStreamException

This error is produced if you don't have Omorfi binaries installed or Python doesn't have access rights to them. Make sure that /usr/local/share/hfst/fi/ or C:\omorfi\hfst\fi exists and can be accessed.

Clone this wiki locally