Create a StringCharFeatures from bytes

162 views Asked by At

I need to create a shogun StringCharFeatures from a list of strings containing non-ascii characters (e.g. "é").

In python 2 this works:

from modshogun import StringCharFeatures, RAWBYTE
StringCharFeatures([u"abcdé".encode('LATIN-1')], RAWBYTE)

but with python 3, it raises an exception:

NotImplementedError: Wrong number or type of arguments for overloaded function 'new_StringCharFeatures'.
  Possible C/C++ prototypes are:
    shogun::CStringFeatures< char >::CStringFeatures()
    shogun::CStringFeatures< char >::CStringFeatures(shogun::EAlphabet)
    shogun::CStringFeatures< char >::CStringFeatures(shogun::SGStringList< char >,shogun::EAlphabet)
    shogun::CStringFeatures< char >::CStringFeatures(shogun::SGStringList< char >,shogun::CAlphabet *)
    shogun::CStringFeatures< char >::CStringFeatures(shogun::CAlphabet *)
    shogun::CStringFeatures< char >::CStringFeatures(shogun::CStringFeatures< char > const &)
    shogun::CStringFeatures< char >::CStringFeatures(shogun::CFile *,shogun::EAlphabet)
    shogun::CStringFeatures< char >::CStringFeatures(shogun::CFile *)

Is there a way to fix it?

1

There are 1 answers

0
Viktor On

this should work with latest develop and the fix will be included 6.2.0