[libvoikko] The semantics of PATH argument for voikko_list_dicts()
Harri Pitkänen
hatapitk at iki.fi
Sun Feb 3 22:36:33 EET 2019
Hi!
Teemu Likonen kirjoitti 2019-02-03 16:22:
> After years I returned to Libvoikko's Common Lisp interface and
> implemented a couple of more functions.
That's great!
> However I am usure how
> voikko_list_dicts() path argument is meant to work because it seems to
> accept any kind of strings and always returns the list of dicts.
It should have the same semantics as the path argument in voikkoInit.
You
can indeed put anything there and still get the dictionaries that exist
within
standard search locations. But in case you put a path to some directory
there
that actually contains some extra dictionaries those should be listed in
addition to the ones in standard locations. If that does not work, it is
a bug. For example if you have some local dictionary under
/opt/extra-dictionaries/5/fi-x-something
and you provide "/opt/extra-dictionaries" as the path argument your
fi-x-something dictionary should be listed there.
> My current Common Lisp implementation actually combines the related C
> functions into one Lisp function: voikko_list_dicts(),
> voikko_dict_language(), voikko_dict_script(), voikko_dict_variant(),
> voikko_dict_description(), voikko_free_dicts().
Yes, that is the way to do it. The only reason why our C API has all
these
functions is that the consumers of the library do not need to know how
to interpret the C (or C++) struct behind the dictionaries. It is hard
to get that right across all the platforms and compilers. The current
design
makes it safe to use for example GCC compiled library on Windows from
application compiled with Visual Studio.
Harri
More information about the Libvoikko
mailing list