Mecab update

Open
#2 · Created  · Last updated

Description

MeCab Github (https://github.com/taku910/mecab) 에서 지난 2015년 이후로 몇 Pull Request가 반영이 되어 업데이트가 있었습니다.

특히 MinGW를 이용해서 윈도우용 빌드를 만들 수 있는 부분은 많이 유용해 보입니다. 조금 더 테스트를 해봐야 하겠지만은 제 환경에서는 빌드가 잘 되었습니다.

그 부분을 패치해 만들어 Pull Request 보냅니다.

  • Apply PR13: Make buildable with MinGW (https://github.com/taku910/mecab/pull/13)

    We get build errors when we build with the following configure on Debian GNU/Linux:

    % sudo apt-get install -y mingw-w64-x86-64-dev % ./configure --prefix=/tmp/mecab --host=x86_64-w64-mingw32

    Here are build errors:

    In file included from tagger.cpp:15:0: stream_wrapper.h: In constructor 'MeCab::ostream_wrapper::ostream_wrapper(const char*)': stream_wrapper.h:49:46: error: no matching function for call to 'std::basic_ofstream<char>::basic_ofstream(const wchar_t*)' os_ = new std::ofstream(WPATH(filename)); ^ stream_wrapper.h:49:46: note: candidates are: In file included from stream_wrapper.h:10:0, from tagger.cpp:15: /usr/lib/gcc/x86_64-w64-mingw32/4.9-win32/include/c++/fstream:643:7: note: std::basic_ofstream<_CharT, _Traits>::basic_ofstream(const char*, std::ios_base::openmode) [with _CharT = char; _Traits = std::char_traits<char>; std::ios_base::openmode = std::_Ios_Openmode] basic_ofstream(const char* __s, ^ /usr/lib/gcc/x86_64-w64-mingw32/4.9-win32/include/c++/fstream:643:7: note: no known conversion for argument 1 from 'const wchar_t*' to 'const char*' /usr/lib/gcc/x86_64-w64-mingw32/4.9-win32/include/c++/fstream:628:7: note: std::basic_ofstream<_CharT, _Traits>::basic_ofstream() [with _CharT = char; _Traits = std::char_traits<char>] basic_ofstream(): __ostream_type(), _M_filebuf() ^ /usr/lib/gcc/x86_64-w64-mingw32/4.9-win32/include/c++/fstream:628:7: note: candidate expects 0 arguments, 1 provided /usr/lib/gcc/x86_64-w64-mingw32/4.9-win32/include/c++/fstream:602:11: note: std::basic_ofstream<char>::basic_ofstream(const std::basic_ofstream<char>&) class basic_ofstream : public basic_ostream<_CharT,_Traits> ^ /usr/lib/gcc/x86_64-w64-mingw32/4.9-win32/include/c++/fstream:602:11: note: no known conversion for argument 1 from 'const wchar_t*' to 'const std::basic_ofstream<char>&'

    These errors are caused because MinGW doesn't support wide stream support streams. See also: http://www.mingw.org/wiki/wide_characters

    WPATH_FORCE() is just for CreateFileW(). MinGW doesn't support wide stream support streams but supports CreateFileW().

  • Apply PR19: fix SWIG preprocessor typos in mecab.h (https://github.com/taku910/mecab/pull/19)

    Without this fix, trying to build mecab for Windows x64 and then mecab-python for x64 python (2.7.10) results in errors: "fatal error LNK1120: 11 unresolved externals".

    Reference for building on Windows 7 x64 and python 2.7 x64: http://pop365.cocolog-nifty.com/blog/2015/03/windows-64bit-m.html http://orion.bluememe.jp/2011/09/windows-64bitmecab.html

    I haven't checked if similar errors occur on Windows x86.

  • Apply PR24: fix Python wrapper: surface text garbled in first call to parseToNode (https://github.com/taku910/mecab/pull/24)

    I applied this patch #5 (comment) It fixes garble collect problem of python.

0 attachments

0 comments

Loading commits...