diff --git a/configure.ac b/configure.ac index ae0622a..ca72c47 100644 --- a/configure.ac +++ b/configure.ac @@ -52,7 +52,7 @@ AC_ARG_WITH([folia], AS_HELP_STRING([--with-folia], [Build with FoLiA support (d AS_IF([test "x$with_folia" = "xyes"], [ AC_MSG_NOTICE( [pkg-config search path: $PKG_CONFIG_PATH] ) - PKG_CHECK_MODULES([folia],[folia >= 0.10]) + PKG_CHECK_MODULES([folia],[folia >= 2.17]) CXXFLAGS="$CXXFLAGS $folia_CFLAGS" LIBS="$folia_LIBS $LIBS" AC_DEFINE([WITHFOLIA],[1],[Compile with libfolia support]) diff --git a/include/classencoder.h b/include/classencoder.h index 1870ef5..f5c70d8 100644 --- a/include/classencoder.h +++ b/include/classencoder.h @@ -23,7 +23,6 @@ #include #ifdef WITHFOLIA -#include "libfolia/document.h" #include "libfolia/folia.h" #endif diff --git a/src/classencoder.cpp b/src/classencoder.cpp index c0965fa..216e363 100644 --- a/src/classencoder.cpp +++ b/src/classencoder.cpp @@ -185,15 +185,15 @@ void ClassEncoder::processcorpus( istream& IN , unordered_map & freqlist, unordered_set * vocab) { folia::Document doc; - doc.readFromFile(filename); + doc.read_from_file(filename); vector words = doc.words(); for (vector::iterator iterw = words.begin(); iterw != words.end(); ++iterw) { - folia::Word * word = *iterw; + const folia::Word * word = *iterw; const string wordtext = word->str(); - if ((vocab == NULL) || (vocab->find(word) != vocab->end()) ) { + if ((vocab == NULL) || (vocab->find(wordtext) != vocab->end()) ) { if ((minlength > 0) || (maxlength > 0)) { - const int l = utf8_strlen(wordtext); + const unsigned int l = utf8_strlen(wordtext); if (((minlength == 0) || (l >= minlength)) && ((maxlength == 0) || (l <= maxlength))) { freqlist[wordtext]++; } @@ -467,7 +467,7 @@ void ClassEncoder::encodefile(const std::string & inputfilename, const std::stri const char zero = 0; //FoLiA folia::Document doc; - doc.readFromFile(inputfilename); + doc.read_from_file(inputfilename); ofstream OUT; if (append) {