Examples of Annotation1


Examples of org.apache.uima.lucas.indexer.types.test.Annotation1

  }
 
  @Test
  public void testReset() throws Exception{
    JCas cas = createCasWithText("token1 token2 token3");
    Annotation1 annotation1 = new Annotation1(cas);
    annotation1.setBegin(0);
    annotation1.setEnd(6);
    annotation1.addToIndexes();
    Annotation1 annotation2 = new Annotation1(cas);
    annotation2.setBegin(7);
    annotation2.setEnd(13);
    annotation2.addToIndexes();
   
    Annotation1 annotation3 = new Annotation1(cas);
    annotation3.setBegin(14);
    annotation3.setEnd(20);
    annotation3.addToIndexes();
   
    AnnotationTokenStream annotationTokenStream = new AnnotationTokenStream(cas, CAS.NAME_DEFAULT_SOFA, "org.apache.uima.lucas.indexer.types.test.Annotation1");
    Token nextToken = annotationTokenStream.next();
    nextToken = annotationTokenStream.next();
    nextToken = annotationTokenStream.next();
View Full Code Here

Examples of org.apache.uima.lucas.indexer.types.test.Annotation1

  }

  @Test
  public void testCreateDocumentTextTokens() throws Exception{
    JCas cas = createCasWithText("token1 token2 token3");
    Annotation1 annotation1 = new Annotation1(cas);
    annotation1.setBegin(0);
    annotation1.setEnd(6);
    annotation1.addToIndexes();
    Annotation1 annotation2 = new Annotation1(cas);
    annotation2.setBegin(7);
    annotation2.setEnd(13);
    annotation2.addToIndexes();
   
    Annotation1 annotation3 = new Annotation1(cas);
    annotation3.setBegin(14);
    annotation3.setEnd(20);
    annotation3.addToIndexes();
   
    AnnotationTokenStream annotationTokenStream = new AnnotationTokenStream(cas, CAS.NAME_DEFAULT_SOFA, "org.apache.uima.lucas.indexer.types.test.Annotation1");
    Token nextToken = annotationTokenStream.next();
    assertNotNull(nextToken);
    assertEquals("token1", new String(nextToken.termBuffer(), 0, nextToken.termLength()));
View Full Code Here

Examples of org.apache.uima.lucas.indexer.types.test.Annotation1

  }
 
  @Test
  public void testCreateFeatureTokens() throws Exception{
    JCas cas = createCasWithText("token1 token2 token3");
    Annotation1 annotation1 = new Annotation1(cas);
    annotation1.setBegin(0);
    annotation1.setEnd(6);
    annotation1.setFeatureString("token1Feature1");
    annotation1.addToIndexes();
   
    Annotation1 annotation2 = new Annotation1(cas);
    annotation2.setFeatureString("token2Feature1");
    annotation2.setBegin(7);
    annotation2.setEnd(13);
    annotation2.addToIndexes();
   
    Annotation1 annotation3 = new Annotation1(cas);
    annotation3.setFeatureString("token3Feature1");
    annotation3.setBegin(14);
    annotation3.setEnd(20);
    annotation3.addToIndexes();   

    AnnotationTokenStream annotationTokenStream = new AnnotationTokenStream(cas, CAS.NAME_DEFAULT_SOFA, "org.apache.uima.lucas.indexer.types.test.Annotation1", "featureString", null);
    Token nextToken = annotationTokenStream.next();
    assertNotNull(nextToken);
    assertEquals("token1Feature1", new String(nextToken.termBuffer(), 0, nextToken.termLength()));
View Full Code Here

Examples of org.apache.uima.lucas.indexer.types.test.Annotation1

  public  void setUp() throws Exception {
    CollectionReaderDescription readerDescription = (CollectionReaderDescription) UIMAFramework.getXMLParser().parseCollectionReaderDescription(new XMLInputSource(READER_DESCRIPTOR));
    reader = UIMAFramework.produceCollectionReader(readerDescription);
    cas = CasCreationUtils.createCas(reader.getProcessingResourceMetaData()).getJCas();
    cas.setDocumentText(DOCUMENT_TEXT);
    annotation1 = new Annotation1(cas);
    annotation1.setBegin(0);
    annotation1.setEnd(6);
    annotation1.addToIndexes();
 
    annotation1Type = annotation1.getType();
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.