Package gate.creole

Examples of gate.creole.ExecutionException


          Annotation token = (Annotation) iterator3.next();

          tokens[i] = token.getFeatures().get("string").toString();
          Object posObj = token.getFeatures().get("category");
          if (posObj == null) {
            throw new ExecutionException(
                "Token found with no POS tag category!\n"
                    + "Did you run a POS tagger before the OpenNLPChunker?");
          }
          postags[i] = posObj.toString();

          i++;
        }

        // run pos chunker
        String[] chunks = chunker.chunk(tokens, postags);

        // add tohose chunk tags to token annotations

        int j = 0;

        for (Iterator iterator4 = annList.iterator(); iterator4
            .hasNext();) {
          Annotation token = (Annotation) iterator4.next();

          FeatureMap fm = token.getFeatures();
          fm.put("chunk", chunks[j]);

          token.setFeatures(fm);

          j++;

        }
      }
    } else {
      throw new ExecutionException("No sentences or tokens to process!\n"
          + "Please run a sentence splitter "
          + "and tokeniser first!");

    }
  }
View Full Code Here

TOP

Related Classes of gate.creole.ExecutionException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.