[libvoikko] Proposed interface for hyphenator components
hatapitk at iki.fi
Tue Nov 24 23:53:37 EET 2009
I have drafted an interface for hyphenator implementations in libvoikko:
Currently this interface has no implementations. It consists of a single
method for hyphenating words and five methods for setting options that affect
subsequent calls to hyphenate method.
The reason why I want to get comments about this interface before implementing
it is that I know it is not flexible enough for languages that require
various non-standard hyphenation features. Apparently these are needed even
in some Nordic languages and we need to change the format of result strings
from Hyphenator::hyphenate to be able to support them. I'd like to know if
you have any suggestions on how to do that. If there is already an existing
format for describing such cases we could save some time by not re-inventing
the wheel here.
Support for non-standard hyphenation in libvoikko will require a change in the
external API as well and that cannot be done in the next release. But if we
can agree on the internal API first, it will be easier to change the external
API in libvoikko 3.0.
You may propose changes to hyphenator option methods as well. At least one of
them (setIntersectCompoundLevel) may seem weird to you. I am not aware of any
real word use cases for it and could consider removing it if you feel that it
is not needed or too specific to the current implementation. The option is
currently available in the external API of libvoikko and when we once broke
it I did receive a bug report. So apparently someone was actually using it
for something. But if there is no publicly available source code
demonstrating its usefullness I could drop it in libvoikko 3.0.
More information about the Libvoikko