[libvoikko] Namespace collisions in HFST and Lttoolbox
Sjur Moshagen
sjurnm at mac.com
Tue Mar 23 10:43:32 EET 2010
Den 17. mar. 2010 kl. 16.31 skrev Harri Pitkänen:
> 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).
I fail to see this as a problem, only as a consequence of the present code status, which is to my knowledge only temporary. My understanding is as follows:
- runtime use of hfst transducers should be done through the runtime library
- the runtime library has no code or dependencies whatsoever on the code and libraries used in the hfst compilers, it is a completely separate piece of code
- the present state of hfst integration with LibVoikko is only temporary, and I guess more or less by accident uses the full hfst library (with the SFST and OpenFST dependencies) instead of the runtime library
That is, the whole issue should go away as soon as the full hfst library is replaced with the runtime library (unless there are namespace issues between the runtime lib and Apertium).
Or is there something that I have missed?
Sjur
More information about the Libvoikko
mailing list