Shard Detail

crystal-mecab v0.1.0

Simple binding to the Mecab Japanese Morphological Analyzer library

Install & Use

Add the following code to your project's shard.yml under:

dependencies to use in production
- OR -
development_dependencies to use in development


crystal-mecab:
  github: rnice01/crystal-mecab

Readme

crystal-mecab

This library provides bindings to the Mecab library for tokenzing japanese Text.

Installation

  1. Install Mecab using the instructions found in the following link: https://taku910.github.io/mecab/#install

The site is in all Japanese but the instructions are pretty straightforward.

  1. Add the dependency to your shard.yml:

    dependencies:
      crystal-mecab:
        github: your-github-user/crystal-mecab
    
  2. Run shards install

Usage

require "crystal-mecab"

CrystalMecab.tokenize_japanese("mecabは速くプログラムするし使いやすいしすごいソフトウェアですよ!").each do |t|
  puts t.to_s
end
#outputs
#
#
#
#
#
#
#
#
#

As of v0.1.0 the only available functionality is to tokenize Japanese text into JapaneseToken structs which provide the word type (noun, verb, etc..) and the reading in Kana which is useful for words in Kanji to get the reading.

Development

TODO: Write development instructions here

Contributing

  1. Fork it (https://github.com/your-github-user/crystal-mecab/fork)
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Contributors