• Paul O'Leary McCann's avatar
    Replace mecab-python3 with fugashi for Japanese tokenization (#6086) · cf3cf304
    Paul O'Leary McCann authored
    
    
    * Replace mecab-python3 with fugashi
    
    This replaces mecab-python3 with fugashi for Japanese tokenization. I am
    the maintainer of both projects.
    
    Both projects are MeCab wrappers, so the underlying C++ code is the
    same. fugashi is the newer wrapper and doesn't use SWIG, so for basic
    use of the MeCab API it's easier to use.
    
    This code insures the use of a version of ipadic installed via pip,
    which should make versioning and tracking down issues easier.
    
    fugashi has wheels for Windows, OSX, and Linux, which will help with
    issues with installing old versions of mecab-python3 on Windows.
    Compared to mecab-python3, because fugashi doesn't use SWIG, it doesn't
    require a C++ runtime to be installed on Windows.
    
    In adding this change I removed some code dealing with `cursor`,
    `token_start`, and `token_end` variables. These variables didn't seem to
    be used for anything, it is unclear to me why they were there.
    
    I ran the tests and they passed, though I couldn't figure out how to run
    the slow tests (`--runslow` gave an error) and didn't try testing with
    Tensorflow.
    
    * Style fix
    
    * Remove unused variable
    
    Forgot to delete this...
    
    * Adapt doc with install instructions
    
    * Fix typo
    Co-authored-by: default avatarsgugger <sylvain.gugger@gmail.com>
    Co-authored-by: default avatarSylvain Gugger <35901082+sgugger@users.noreply.github.com>
    cf3cf304
setup.cfg 739 Bytes