Coder Social home page Coder Social logo

mozcpy's Introduction

mozcpy

circleci pyversion latest version license

Mozc for Python: yet another Kana-Kanji converter

INSTALLATION

$ pip install mozcpy

USAGE

import mozcpy

converter = mozcpy.Converter()
converter.convert('まほうしょうじょ')
# => '魔法少女'
converter.convert('まほうしょうじょ', n_best=10)
# => ['魔法少女', '魔法消除', '魔法省所', '魔法小所', '魔法昇叙', '魔砲少女', 'マホウ少女', '魔法証所', '魔法賞所']

converter.convert_wakati('もうなにもこわくない')
# => 'もう 何 も 怖く ない'
converter.convert_wakati('もうなにもこわくない', n_best=3)
# => ['もう 何 も 怖く ない', 'もう 何 も こわく ない', 'もう 何 も 恐く ない']

converter.wakati("もうなにもこわくない")
# => 'もう なに も こわく ない'
converter.wakati("もうなにもこわくない", n_best=10)  # duplicatetions are ignored
# => ['もう なに も こわく ない']

ACKNOWLEDGEMENT

This module relies on Mozc and MeCab.

    1. Kudo, T. Hanaoka, J. Mukai, Y. Tabata, H. Komatsu. 2011. Efficient dictionary and language model compression for input method editors. In Proceedings of the Workshop on Advances in Text Input Methods (WTIM 2011), pp 19-25.
    1. Kudo, H. Komatsu, T. Hanaoka, A. Mukai, Y. Tabata, K. Yamamoto, Y. Matsumoto. 2004. Applying Conditional Random Fields to Japanese Morphological Analysis. In Proceedings of the EMNLP 2004, pp 230-237.

mozcpy's People

Contributors

ikegami-yukino avatar tyo-yo avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.