Skip to content

Instantly share code, notes, and snippets.

@fasiha
Last active December 23, 2023 05:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fasiha/fffa8914d25660859ad97da1eafd92cb to your computer and use it in GitHub Desktop.
Save fasiha/fffa8914d25660859ad97da1eafd92cb to your computer and use it in GitHub Desktop.
J.DepP usage and output example

Example output

➜ echo あの壁にかかっている絵はきれいですね | mecab -d /usr/local/lib/mecab/dic/unidic | jdepp 2> /dev/null | to_tree.py
# S-ID: 1; J.DepP
  0:         あの━━┓
  1:   壁に━━┓     ┃
  2:  かかっている━━┓  ┃
  3:         絵は━━┫
  4:        きれいですねEOS
➜ echo あの壁にかかっている絵はきれいですね | mecab -d /usr/local/lib/mecab/dic/unidic | jdepp 2> /dev/null | to_chunk.py
# S-ID: 1; J.DepP
あの │ 壁 に │ かかっ て いる │ 絵 は │ きれい です ね EOS

Download and install instructions on Naoki Yoshinaga's website: http://www.tkl.iis.u-tokyo.ac.jp/~ynaga/jdepp/#dl

@MeikyuuTrader
Copy link

I was actually only using jdepp to create "words" and then I'd search the definition. More or less copying your method from the stackoverlfow post. So more advance stuff isn't going to be touched.

It's unfortunate that you can't get rid of the extra dependencies, like particles, to get the real word.

@fasiha
Copy link
Author

fasiha commented Dec 23, 2023

@MeikyuuTrader have you seen Ichiran? https://ichi.moe and https://github.com/tshatrov/ichiran its a very nice way (and an alternative to MeCab + JDepP) to find particles, etc. but via a totally different technique.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment