pyfst
pyfst copied to clipboard
No suitable method found
Hi,
I am working on Ubuntu 14.04 and have a working version of openfst 1.3.4 installed. The one step installation process in the Readme doesn't seem to work for me.
LIBRARY_PATH=$FST/lib:$FST/lib/fst CPLUS_INCLUDE_PATH=$FST/include python setup.py build_ext --inplace
The paths are correct but I'm getting the following error from Cython "no suitable method found" on the call to libfst.Replace in the replace method. It seems that Cython can't match the provided argument types with the ones expected by libfst in any version of the overloaded function Replace.
Commenting out that function make the module build successfully. At this stage I don't really know what to do. The arg types seem sound and compliant with the doc of libfst and especially this function :
void fst::Replace ( const std::vector< std::pair< typename Arc::Label, const Fst< Arc > * >> & ifst_array,
MutableFst< Arc > * ofst,
typename Arc::Label root,
bool epsilon_on_replace
)
Running
nm *.so -C | grep "Replace<"
in the fst lib directory tells me this among other things :
void fst::Replace<fst::ArcTpl<fst::LogWeightTpl<double> > >(std::vector<std::pair<fst::ArcTpl<fst::LogWeightTpl<double> >::Label, fst::Fst<fst::ArcTpl<fst::LogWeightTpl<double> > > const*>, std::allocator<std::pair<fst::ArcTpl<fst::LogWeightTpl<double> >::Label, fst::Fst<fst::ArcTpl<fst::LogWeightTpl<double> > > const*> > > const&, fst::MutableFst<fst::ArcTpl<fst::LogWeightTpl<double> > >*, fst::ArcTpl<fst::LogWeightTpl<double> >::Label, bool)
which leads me to think that the problem might be coming from the allocator because I have no clue what it could be otherwise. I've tried using doubles and floats instead of ints but that doesn't change anything to the problem.
Any help would be much appreciated ! Thanks