Giter Club home page Giter Club logo

cl-mecab's Introduction

cl-mecab

Usage

(ql:quickload :cl-mecab)

(cl-mecab:with-mecab ()
  (cl-mecab:parse* "今日の天気は晴れです"))
;; =>
;; (("今日" "名詞" "副詞可能" "*" "*" "*" "*" "今日" "キョウ" "キョー")
;;  ("の" "助詞" "連体化" "*" "*" "*" "*" "の" "ノ" "ノ")
;;  ("天気" "名詞" "一般" "*" "*" "*" "*" "天気" "テンキ" "テンキ")
;;  ("は" "助詞" "係助詞" "*" "*" "*" "*" "は" "ハ" "ワ")
;;  ("晴れ" "名詞" "一般" "*" "*" "*" "*" "晴れ" "ハレ" "ハレ")
;;  ("です" "助動詞" "*" "*" "*" "特殊・デス" "基本形" "です" "デス" "デス"))

Installation

Assuming you already installed MeCab.

(ql:quickload :cl-mecab)

APIs

(with-mecab (&optional (option "")) &body body)

This macro makes MeCab Tagger and enables function parse within the body. The MeCab Tagger will be made only once while that execution. The option is taken MeCab Tagger initialization.

(with-mecab* (&optional (option "")) &body body)

This macro similar to with-mecab. but, this creates MeCab Tagger each call.

(load-tagger &optional (option ""))

This function makes MeCab Tagger on global. You can use function parse after calling the load-tagger only once. This is useful for experimental implementations.

(parse text)

This function parses the text by MeCab Tagger and returns result as a string.

(parse* text)

This function parses the text by MeCab Tagger and returns result as list seems above example.

Author

Copyright

Copyright (c) 2016-2018 carrotflakes ([email protected])

License

Licensed under the LLGPL License.

cl-mecab's People

Contributors

carrotflakes avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

cl-mecab's Issues

reconsider 'with-mecab'

This does not work.

(with-mecab ("-d /usr/local/lib/mecab/dic/ipadic")
  (defun foo (text)
    (parse* text)))

This works, but it calls make-mecab every time.

(defun foo (text)
  (with-mecab ("-d /usr/local/lib/mecab/dic/ipadic")
    (parse* text)))

Should with-mecab make a MeCab Tagger at macro expansion time?

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.