Examples of LookupWindowAnnotation


Examples of org.apache.ctakes.typesystem.type.textspan.LookupWindowAnnotation

  // FIXME use parser output instead of LWA
  public String calcmNPHead () {
    Annotation a = m.getContent();
    FSIterator iter = jcas.getJFSIndexRepository().getAnnotationIndex(LookupWindowAnnotation.type).iterator();
    while (iter.hasNext()) {
      LookupWindowAnnotation lwa = (LookupWindowAnnotation) iter.next();
      if (lwa.getBegin()<=a.getBegin() && lwa.getEnd()==a.getEnd())
        return "yes";
    }
    return "no";
  }
View Full Code Here

Examples of org.apache.ctakes.typesystem.type.textspan.LookupWindowAnnotation

  public String calcNPHead () {
    Annotation a = m1.getContent();
//    return (a.getEnd()==m1.getEnd() && a.getBegin()>m1.getBegin()) ? "yes" : "no";
    FSIterator iter = jcas.getJFSIndexRepository().getAnnotationIndex(LookupWindowAnnotation.type).iterator();
    while (iter.hasNext()) {
      LookupWindowAnnotation lwa = (LookupWindowAnnotation) iter.next();
      if (lwa.getBegin()<=a.getBegin() && lwa.getEnd()==a.getEnd())
        return "yes";
    }
    return "no";
  }
View Full Code Here

Examples of org.apache.ctakes.typesystem.type.textspan.LookupWindowAnnotation

    @Override
    public void process(JCas jCas) throws AnalysisEngineProcessException {
      for (Chunk chunk : JCasUtil.select(jCas, Chunk.class)) {
        if (chunk.getChunkType().equals("NP")) {
          new LookupWindowAnnotation(jCas, chunk.getBegin(), chunk.getEnd()).addToIndexes();
        }
      }
    }
View Full Code Here

Examples of org.apache.ctakes.typesystem.type.textspan.LookupWindowAnnotation

    @Override
    public void process(JCas jCas) throws AnalysisEngineProcessException {
      List<LookupWindowAnnotation> lws = new ArrayList<LookupWindowAnnotation>(JCasUtil.select(jCas, LookupWindowAnnotation.class));
      // we'll navigate backwards so that as we delete things we shorten the list from the back
      for(int i = lws.size()-2; i >= 0; i--){
        LookupWindowAnnotation lw1 = lws.get(i);
        LookupWindowAnnotation lw2 = lws.get(i+1);
        if(lw1.getBegin() <= lw2.getBegin() && lw1.getEnd() >= lw2.getEnd()){
          /// lw1 envelops or encloses lw2
          lws.remove(i+1);
          lw2.removeFromIndexes();
        }
      }
     
    }
View Full Code Here

Examples of org.apache.ctakes.typesystem.type.textspan.LookupWindowAnnotation

      jCas.setDocumentText(text);
      WordToken tok = new WordToken(jCas);
      tok.setBegin(0);
      tok.setEnd(text.length());
      tok.addToIndexes();
      LookupWindowAnnotation lwa = new LookupWindowAnnotation(jCas);
      lwa.setBegin(0);
      lwa.setEnd(text.length());
      lwa.addToIndexes();
    AggregateBuilder builder = new AggregateBuilder();
    addDescriptor(builder,
        "desc/analysis_engine/DictionaryLookupAnnotator.xml");
    AnalysisEngine engine = builder.createAggregate();
    engine.process(jCas);
View Full Code Here

Examples of org.apache.ctakes.typesystem.type.textspan.LookupWindowAnnotation

    @Override
    public void process(JCas jCas) throws AnalysisEngineProcessException {
      for (Chunk chunk : JCasUtil.select(jCas, Chunk.class)) {
        if (chunk.getChunkType().equals("NP")) {
          new LookupWindowAnnotation(jCas, chunk.getBegin(), chunk.getEnd()).addToIndexes();
        }
      }
    }
View Full Code Here

Examples of org.apache.ctakes.typesystem.type.textspan.LookupWindowAnnotation

    @Override
    public void process(JCas jCas) throws AnalysisEngineProcessException {
      List<LookupWindowAnnotation> lws = new ArrayList<>(JCasUtil.select(jCas, LookupWindowAnnotation.class));
      // we'll navigate backwards so that as we delete things we shorten the list from the back
      for(int i = lws.size()-2; i >= 0; i--){
        LookupWindowAnnotation lw1 = lws.get(i);
        LookupWindowAnnotation lw2 = lws.get(i+1);
        if(lw1.getBegin() <= lw2.getBegin() && lw1.getEnd() >= lw2.getEnd()){
          /// lw1 envelops or encloses lw2
          lws.remove(i+1);
          lw2.removeFromIndexes();
        }
      }
     
    }
View Full Code Here

Examples of org.apache.ctakes.typesystem.type.textspan.LookupWindowAnnotation

  // FIXME use parser output instead of LWA
  public String calcmNPHead () {
    Annotation a = m.getContent();
    FSIterator iter = jcas.getJFSIndexRepository().getAnnotationIndex(LookupWindowAnnotation.type).iterator();
    while (iter.hasNext()) {
      LookupWindowAnnotation lwa = (LookupWindowAnnotation) iter.next();
      if (lwa.getBegin()<=a.getBegin() && lwa.getEnd()==a.getEnd())
        return "yes";
    }
    return "no";
  }
View Full Code Here

Examples of org.apache.ctakes.typesystem.type.textspan.LookupWindowAnnotation

  public boolean calcNPHead () {
    Annotation a = m1.getContent();
//    return (a.getEnd()==m1.getEnd() && a.getBegin()>m1.getBegin()) ? "yes" : "no";
    FSIterator iter = jcas.getJFSIndexRepository().getAnnotationIndex(LookupWindowAnnotation.type).iterator();
    while (iter.hasNext()) {
      LookupWindowAnnotation lwa = (LookupWindowAnnotation) iter.next();
      if (lwa.getBegin()<=a.getBegin() && lwa.getEnd()==a.getEnd())
        return true;
    }
    return false;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.