Sudachi (sudachi v0.1.0)

sudachi_ex is the Elixir binding of Sudachi, the Japanese morphological analyzer.

Installation

the sudachi_ex is installed by adding sudachi to your list of dependencies in mix.exs:

def deps do
  [
    {:sudachi, "~> 0.1.0"}
  ]
end

You need to featch a sudachi dictionary:

mix sudachi.fetch_dic

Link to this section Summary

Functions

Analize the text and return the list of morphemes.

Link to this section Functions

Link to this function

analize(text, opts \\ [])

Analize the text and return the list of morphemes.

Parameters

  • text - input text.
  • opts - analysis options
    • :all - Include extended analysis.
    • :debug - with debug outputs.

Examples

  iex> res = Sudachi.analize("打込む かつ丼 附属 vintage")
  [
    ["打込む", "動詞", "一般", "*", "*", "五段-マ行", "終止形-一般", "打ち込む"],
    [" ", "空白", "*", "*", "*", "*", "*", " "],
    ["かつ丼", "名詞", "普通名詞", "一般", "*", "*", "*", "カツ丼"],
    [" ", "空白", "*", "*", "*", "*", "*", " "],
    ["附属", "名詞", "普通名詞", "サ変可能", "*", "*", "*", "付属"],
    [" ", "空白", "*", "*", "*", "*", "*", " "],
    ["vintage", "名詞", "普通名詞", "一般", "*", "*", "*", "ビンテージ"]
  ]