You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@opennlp.apache.org by "Eugen Hanussek (JIRA)" <ji...@apache.org> on 2014/07/04 12:01:37 UTC

[jira] [Created] (OPENNLP-704) IllegalStateException: Must be started first! in SentenceDetectorTool

Eugen Hanussek created OPENNLP-704:
--------------------------------------

             Summary: IllegalStateException: Must be started first! in SentenceDetectorTool
                 Key: OPENNLP-704
                 URL: https://issues.apache.org/jira/browse/OPENNLP-704
             Project: OpenNLP
          Issue Type: Bug
          Components: Command Line Interface
    Affects Versions: 1.6.0
            Reporter: Eugen Hanussek
            Priority: Trivial


trying to use the cmd-line too, see [doku|http://opennlp.apache.org/documentation/1.5.3/manual/opennlp.html#tools.sentdetect.detection.cmdline], I get the exception:

{noformat}
C:\proj\apache-opennlp-1.6.0-SNAPSHOT\bin>opennlp SentenceDetector de-sent.bin < en-sent-input.txt
Loading Sentence Detector model ... done (0,078s)
Pierre Vinken, 61 years old, will join the board as a nonexecutive director Nov.
29. Mr.
Vinken is
chairman of Elsevier N.V., the Dutch publishing group.
Rudolph Agnew, 55 years
old and former chairman of Consolidated Gold Fields PLC, was named a director of this
British industrial conglomerate.
Exception in thread "main" java.lang.IllegalStateException: Must be started first!
        at opennlp.tools.cmdline.PerformanceMonitor.incrementCounter(PerformanceMonitor.java:68)
        at opennlp.tools.cmdline.sentdetect.SentenceDetectorTool.run(SentenceDetectorTool.java:76)
        at opennlp.tools.cmdline.CLI.main(CLI.java:227)
{noformat}

I fixed it localy in SentenceDetectorTool:
{noformat}
...
  public void run(String[] args) {

...
      PerformanceMonitor perfMon = new PerformanceMonitor(System.err, "sent");

      try {
        perfMon.start();     // <==== the fix
...
{noformat}



--
This message was sent by Atlassian JIRA
(v6.2#6252)