tanloong / neosca

L2SCA & LCA fork: cross-platform, GUI, without Java dependency
GNU General Public License v3.0
28 stars 7 forks source link

TypeError: Class edu.stanford.nlp.parser.lexparser.LexicalizedParser is not found #19

Closed tanloong closed 1 year ago

tanloong commented 1 year ago

The program raises the error If the $STANFORD_PARSER_HOME contains Chinese chars.

PS C:\Users\Administrator> $env:STANFORD_PARSER_HOME
...
C:\Users\Administrator\AppData\Roaming\中文目录\stanford-parser-full-2020-11-17
PS C:\Users\Administrator> nsca --text "This is a test." --stdout
...
Command-line text: This is a test.
Java has already been installed. ok
Stanford Parser has already been installed. ok
Stanford Tregex has already been installed. ok
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Scripts\nsca.exe\__main__.py", line 7, in <module>
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\neosca\main.py", line 597, in main
    success, err_msg = ui.run()
                       ^^^^^^^^
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\neosca\main.py", line 560, in run
    return self.run_on_text()  # type: ignore
           ^^^^^^^^^^^^^^^^^^
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\neosca\main.py", line 527, in wrapper
    func(self, *args, **kwargs)  # type: ignore
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\neosca\main.py", line 538, in run_on_text
    analyzer.run_on_text(self.options.text)
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\neosca\neosca.py", line 99, in run_on_text
    trees = self.parse_text(text)
            ^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\neosca\neosca.py", line 82, in parse_text
    self.parser = StanfordParser(
                  ^^^^^^^^^^^^^^^
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\neosca\parser.py", line 44, in __init__
    self.init_parser()
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\neosca\parser.py", line 58, in init_parser
    LexicalizedParser = JClass(self.PARSER_GRAMMAR)
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\jpype\_jclass.py", line 99, in __new__
    return _jpype._getClass(jc)
           ^^^^^^^^^^^^^^^^^^^^
TypeError: Class edu.stanford.nlp.parser.lexparser.LexicalizedParser is not found