Last active
August 24, 2016 06:27
-
-
Save kuroshiba-Ginji/ed9c1298412942b4b392afa43e4db767 to your computer and use it in GitHub Desktop.
Windows 7 64bit に MeCab (和布蕪) と Python のバインディングを導入 (2016/08/18) ref: http://qiita.com/tobesan/items/6b6f3a025fdd177ef52a
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(旧)case 't': os_ << (size_t)path->rnode->char_type; break; | |
(新)case 't': os_ << (unsigned int)path->rnode->char_type; break; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> python setup.py build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> python setup.py install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>python | |
Python 2.7.11 | |
> import MeCab | |
> import sys | |
> m = MeCab.Tagger('mecabrc') | |
> f = open('text.txt','r') | |
> text = f.read().decode('utf-8') | |
> f.close() | |
> f = open('result.txt','w') | |
> f.write(m.parse(text.encode('utf-8'))) | |
> f.close() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64 | |
> nmake -f Makefile.msvc.in |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(旧) -DMECAB_DEFAULT_RC="\"c:\\Program Files\\mecab\\etc\\mecabrc\"" | |
(新) -DMECAB_DEFAULT_RC="\"c:\\mecab\\etc\\mecabrc\"" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(新) #include <iterator> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
from distutils.core import setup,Extension,os | |
setup(name = "mecab-python", | |
version = "0.996", | |
py_modules=["MeCab"], | |
ext_modules = [ | |
Extension("_MeCab", | |
["MeCab_wrap.cxx",], | |
include_dirs=[r"C:\Mecab\sdk"], | |
library_dirs=[r"C:\Mecab\sdk"], | |
libraries=["libmecab"]) | |
]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
横須賀の米軍基地見学楽しかった! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(旧)case 'L': *os << (size_t)lattice->size(); break; | |
(新)case 'L': *os << (unsigned int)lattice->size(); break; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment