0
我想在另一個代碼中調用一個函數的主要方法。調用另一個類的主要方法
在命令行中,我試圖重現的例子是:
java -cp stanford-ner.jar edu.stanford.nlp.ie.crf.CRFClassifier -loadClassifier ner-model.ser.gz -testFile jane-austen-emma-ch2.tsv
從here
在我的代碼,我寫道:
String[] args = {"-loadClassifier ner-model.ser.gz",
"-testFile jane-austen-emma-ch2.tsv"};
CRFClassifier.main(args);
但是當我嘗試執行此代碼,我得到以下錯誤:
Unknown property |loadClassifier ner-model.ser.gz|
Unknown property |testFile jane-austen-emma-ch2.tsv|
如何從我的代碼中調用主函數?