➜ 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
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.