Closed JSB97 closed 4 years ago
Hi!
I believe that sudachipy is working properly, and it is waiting for input text. You can start typing something and see how it goes; (The second line 高輪ゲートウェイ駅
is the user input)
$ sudachipy -r /Users/me/.pyenv/versions/3.6.1/lib/python3.6/site-packages/sudachipy/resources/sudachi.json
高輪ゲートウェイ駅
高輪ゲートウェイ駅 名詞,固有名詞,一般,*,*,* 高輪ゲートウェイ駅
EOS
Alternatively, you can pass text with the pipe;
$ echo "高輪ゲートウェイ駅" | sudachipy
高輪ゲートウェイ駅 名詞,固有名詞,一般,*,*,* 高輪ゲートウェイ駅
EOS
sudachi.json
) and the character definition file (char.def
)We need the "character definition file", char.def
, which is by default under sudachipy/resources/
(the same directory as the default sudachi.json
file) for the analysis. This file defines the types of characters.
Therefore the "characterDefinitionFile"
field in the setting file (sudachi.json
) is essential. Hence in your last example, you got an error KeyError: 'characterDefinitionFile not defined in setting file'
.
In your the other example, I believe you go an error because the path of characterDefinitionFile
defined in the sudachi.json
is invalid, as the path is relative. You can copy the sudachipy/resources/char.def
to the same location where your sudachi.json
is, or rewrite the path in the setting file. You will need to do the same for the similar files unk.def
and rewrite.def
.
How embarassing... Thank you for pointing out how to use it from the terminal. 助かりました:bow:
I am trying to run sudachipy from the command line with a user dictionary, using these instructions.
When i try to run the below, the command seems to just hang and nothing happens:
If instead I placed the sudachi.json file in my local directory which is possible from what the documentation says ('anywhere you like'), i get this error:
Furthermore, if i run the same command with
"characterDefinitionFile" : "char.def",
line removed, i get this error:What am i doing wrong here? Thank you as always!