Merge with stable.

This commit is contained in:
Georg Brandl 2014-11-04 08:52:17 +01:00
commit d06ede265d
3 changed files with 5 additions and 3 deletions

View File

@ -190,6 +190,8 @@ Bugs fixed
develop builder extensions. Thanks to Takeshi Komiya.
* #1584: Point to master doc in HTML "top" link.
* #1585: Autosummary of modules broken in Sphinx-1.2.3.
* #1610: Sphinx cause AttributeError when MeCab search option is enabled and
python-mecab is not installed.
Documentation
-------------

View File

@ -51,6 +51,7 @@ Documentation using the default theme
* PyMQI: http://pythonhosted.org/pymqi/
* PyPubSub: http://pubsub.sourceforge.net/
* pyrticle: http://documen.tician.de/pyrticle/
* pySPACE: http://pyspace.github.io/pyspace/
* Python: http://docs.python.org/
* python-apt: http://apt.alioth.debian.org/python-apt-doc/
* PyUblas: http://documen.tician.de/pyublas/

View File

@ -48,7 +48,7 @@ class MecabBinder(object):
result = self.native.parse(input2)
else:
result = self.ctypes_libmecab.mecab_sparse_tostr(
self.ctypes_mecab, input)
self.ctypes_mecab, input.encode(self.dict_encode))
return result.decode(self.dict_encode).split(' ')
def init_native(self, options):
@ -85,7 +85,7 @@ class MecabBinder(object):
self.ctypes_libmecab = ctypes.CDLL(libpath)
self.ctypes_libmecab.mecab_sparse_tostr.restype = ctypes.c_char_p
self.ctypes_mecab = self.libmecab.mecab_new2(param)
self.ctypes_mecab = self.ctypes_libmecab.mecab_new2(param)
def __del__(self):
if self.ctypes_libmecab:
@ -263,7 +263,6 @@ class SearchJapanese(SearchLanguage):
if type not in ('mecab', 'default'):
raise ValueError(("Japanese tokenizer's type should be 'mecab'"
" or 'default'"))
self.libmecab = None
if type == 'mecab':
self.splitter = MecabBinder(options)
else: