[libvoikko] Namespace collisions in HFST and Lttoolbox
flammie at iki.fi
Thu Mar 18 01:11:06 EET 2010
2010-03-17, Harri Pitkänen sanoi:
> On Wednesday 17 March 2010, Flammie Pirinen wrote:
> > > Another problem is that both HFST and Lttoolbox introduce some
> > > classes in the default namespace. Since the libraries serve
> > > similar purposes it is not a surprise that some of the classes
> > > have exactly same names. Here are some examples, there might be
> > > others too:
> > Hfst 3 was designed to avoid pollution of default namespace, so
> > moving to it will at least solve problem.
> How are you going to do this on runtime? I assumed that you were
> going to change the headers which would indeed fix this compilation
> error. But as long as SFST library is linked against the rest of HFST
> namespace collisions can still occur when the compiled program is run
> (wrong methods get called).
> The only ways to fix this problem without fixing SFST would (as far
> as I can figure right now) are either to move the use of SFST to a
> separate process or use some runtime linker tricks (which usually are
> not portable).
You are correct, only workable solution at the moment I've thought of
is to fix SFST, which also means patching and bundling it unless the
suggested changes find their way to upstream. It isn't very pretty or
good for maintenance, but I suppose it works well enough at least for
the pre-beta cycle or whatever.
Flammie, computer scientist bachelor, linguist master, free software
Finnish localiser, and more! <http://www.iki.fi/flammie/>
More information about the Libvoikko