Uploaded image for project: 'OpenNLP'
  1. OpenNLP
  2. OPENNLP-704

IllegalStateException: Must be started first! in SentenceDetectorTool

    XMLWordPrintableJSON

Details

    Description

      trying to use the cmd-line tool, see doku, I get the exception:

      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)
      

      I fixed it localy in SentenceDetectorTool:

      ...
        public void run(String[] args) {
      
      ...
            PerformanceMonitor perfMon = new PerformanceMonitor(System.err, "sent");
      
            try {
              perfMon.start();     // <==== the fix
      ...
      

      Attachments

        Activity

          People

            vinhkhuc Vinh Khuc
            eugenh Eugen Hanussek
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: