Package org.apache.ctakes.typesystem.type.syntax

Examples of org.apache.ctakes.typesystem.type.syntax.Chunk


  public static ArrayList<Chunk> selectDemonAndRelative (JCas jcas) {
    ArrayList<Chunk> ret = new ArrayList<Chunk>();
    FSIterator iter = jcas.getJFSIndexRepository().getAnnotationIndex(Chunk.type).iterator();
    while (iter.hasNext()) {
      Chunk c = (Chunk)iter.next();
      if (c.getChunkType().equals("NP")) {
        String s = c.getCoveredText().toLowerCase();
        if (s.startsWith("these") ||
          s.startsWith("those") ||
          s.startsWith("this") ||
          s.startsWith("that") ||
          s.startsWith("which"))
View Full Code Here


  public void initialize(UimaContext annotatorContext) throws ResourceInitializationException {
    /* no initialization necessary */
  }

  public Annotation createChunk(JCas jCas, int start, int end, String chunkType) {
    Chunk chunk = new Chunk(jCas, start, end);
    chunk.setChunkType(chunkType);
    chunk.addToIndexes();
    return chunk;
  }
View Full Code Here

  public void initialize(UimaContext uimaContext) throws ResourceInitializationException {
    /* no initialization required */
  }

  public Annotation createChunk(JCas jCas, int start, int end, String chunkType) {
    Chunk chunk;
    if(chunkType.equals("ADJP")) {
      chunk = new ADJP(jCas, start, end);
    } else if(chunkType.equals("ADVP")) {
      chunk = new ADVP(jCas, start, end);
    } else if(chunkType.equals("CONJP")) {
      chunk = new CONJP(jCas, start, end);
    } else if(chunkType.equals("INTJ")) {
      chunk = new INTJ(jCas, start, end);
    } else if(chunkType.equals("LST")) {
      chunk = new LST(jCas, start, end);
    } else if(chunkType.equals("NP")) {
      chunk = new NP(jCas, start, end);
    } else if(chunkType.equals("PP")) {
      chunk = new PP(jCas, start, end);
    } else if(chunkType.equals("PRT")) {
      chunk = new PRT(jCas, start, end);
    } else if(chunkType.equals("SBAR")) {
      chunk = new SBAR(jCas, start, end);
    } else if(chunkType.equals("UCP")) {
      chunk = new UCP(jCas, start, end);
    } else if(chunkType.equals("VP")) {
      chunk = new VP(jCas, start, end);
    } else if(chunkType.equals("O")) {
      chunk = new O(jCas, start, end);
    } else {
      chunk = new Chunk(jCas, start, end);
    }
       
    chunk.setChunkType(chunkType);
    chunk.addToIndexes();
    return chunk;
  }
View Full Code Here

    // If so, extend the end offset of the <code>i</code> +
    // <code>indexOfTokenToInclude</code>
    for (int i = 0; i < chunkList.size(); i++) {

      boolean matches = true;
      Chunk chunk = chunkList.get(i);

      while (matches == true) {
        matches = compareToPattern(chunkList, i);
        if (matches) {
          extendChunk(chunk, chunkList.get(i + indexOfTokenToInclude)
View Full Code Here

    // If so, extend the end offset of the <code>i</code> +
    // <code>indexOfTokenToInclude</code>
    for (int i = 0; i < chunkList.size(); i++) {

      boolean matches = true;
      Chunk chunk = chunkList.get(i);

      while (matches == true) {
        matches = compareToPattern(chunkList, i);
        if (matches) {
          extendChunk(chunk, chunkList.get(i + indexOfTokenToInclude)
View Full Code Here

    // If so, extend the end offset of the <code>i</code> +
    // <code>indexOfTokenToInclude</code>
    for (int i = 0; i < chunkList.size(); i++) {

      boolean matches = true;
      Chunk chunk = chunkList.get(i);

      while (matches == true) {
        matches = compareToPattern(chunkList, i);
        if (matches) {
          extendChunk(chunk, chunkList.get(i + indexOfTokenToInclude)
View Full Code Here

    // If so, extend the end offset of the <code>i</code> +
    // <code>indexOfTokenToInclude</code>
    for (int i = 0; i < chunkList.size(); i++) {

      boolean matches = true;
      Chunk chunk = chunkList.get(i);

      while (matches == true) {
        matches = compareToPattern(chunkList, i);
        if (matches) {
          extendChunk(chunk, chunkList.get(i + indexOfTokenToInclude)
View Full Code Here

  public static ArrayList<Chunk> selectDemonAndRelative (JCas jcas) {
    ArrayList<Chunk> ret = new ArrayList<Chunk>();
    FSIterator<Annotation> iter = jcas.getJFSIndexRepository().getAnnotationIndex(Chunk.type).iterator();
    while (iter.hasNext()) {
      Chunk c = (Chunk)iter.next();
      if (c.getChunkType().equals("NP")) {
        String s = c.getCoveredText().toLowerCase();
        if (s.startsWith("these") ||
          s.startsWith("those") ||
          s.startsWith("this") ||
          s.startsWith("that") ||
          s.startsWith("which"))
View Full Code Here

    nextID += lw.size();

    ArrayList<Chunk> lc = AnnotationSelector.selectDemonAndRelative(aJCas);
    for (int i = 0; i < lc.size(); ++i) {
      Chunk c = lc.get(i);
      DemMarkable m = new DemMarkable(aJCas, c.getBegin(), c.getEnd());
      m.setContent(c);
      m.setId(nextID + i);
      m.addToIndexes();
    }
View Full Code Here

  public void initialize(UimaContext annotatorContext) throws ResourceInitializationException {

  }

  public Annotation createChunk(JCas jCas, int start, int end, String chunkType) {
    Chunk chunk = new Chunk(jCas, start, end);
    chunk.setChunkType(chunkType);
    chunk.addToIndexes();
    return chunk;
  }
View Full Code Here

TOP

Related Classes of org.apache.ctakes.typesystem.type.syntax.Chunk

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.