Skip to content
Brooke M. Fujita edited this page Apr 6, 2015 · 3 revisions

Usage

Before You Begin Parsing

Before you start using Natto::MeCab, I highly suggest trying out mecab from the command-line. Spend some time acquainting yourself with the many high-level options that come with MeCab. If you find that the stock output formats do not do what you want, then come up with your own. Also, please pay close attention to the encodings of both MeCab and the dictionaries used.

Ruby Version and String-handling

Please use Ruby 1.9 or greater. Strings and encodings are handled correctly from Ruby 1.9 onward, which will make your parsing and processing that much easier.

Usage Examples

Here are some simple examples for using Natto::MeCab:

  1. とりあえず使ってみよう!: Start using Natto::MeCab to check your MeCab and dictionary info, parse a sentence using default chasen format
  2. わかち書き Parsing: Tokenize a sentence into its parts of speech
  3. N-Best 読み: Obtain the 2 best probable readings for a list of kanji
  4. 振り仮名変換: Converting kanji in text to furigana
  5. 出力フォーマットの指定: User-defined Output Formatting
  6. 制約付き解析(部分解析): Constraint Parsing (Partial Parsing)

Previous | Home | Next

Clone this wiki locally