Package edu.stanford.nlp.ling

Examples of edu.stanford.nlp.ling.AbstractCoreLabel


    List<List<AbstractCoreLabel>> namedEntities = Generics.newArrayList();
    List<AbstractCoreLabel> ne = Generics.newArrayList();
    String previousNEType = "";
    int previousNEIndex = -1;
    for (int i = 0; i < words.size(); i++) {
      AbstractCoreLabel word = words.get(i);
      if(!word.ner().equals("O")) {
        if (!word.ner().equals(previousNEType) || previousNEIndex != i-1) {
          ne = Generics.newArrayList();
          namedEntities.add(ne);
        }
        ne.add(word);
        previousNEType = word.ner();
        previousNEIndex = i;
      }
    }

    List<String> neStrings = new ArrayList<String>();
View Full Code Here

TOP

Related Classes of edu.stanford.nlp.ling.AbstractCoreLabel

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.