Package org.apache.uima.lucas.indexer.types.test

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


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

    List<String> featureNames = new ArrayList<String>();
    featureNames.add("featureString");
    featureNames.add("featureInteger");
   
View Full Code Here


 
 
  @Test
  public void testCreateArrayFeatureTokensWithoutDelimiter() throws Exception{
    JCas cas = createCasWithText("token1 token2 token3");
    Annotation1 annotation1 = new Annotation1(cas);
    annotation1.setBegin(0);
    annotation1.setEnd(6);
    StringArray stringArray1 = new StringArray(cas, 3);
    stringArray1.set(0, "token1FeatureStringArray1");
    stringArray1.set(1, "token1FeatureStringArray2");
    stringArray1.set(2, "token1FeatureStringArray3");
    annotation1.setFeatureStringArray(stringArray1);
    annotation1.addToIndexes();
   
    Annotation1 annotation2 = new Annotation1(cas);
    annotation2.setBegin(7);
    annotation2.setEnd(13);
    StringArray stringArray2 = new StringArray(cas, 3);
    stringArray2.set(0, "token2FeatureStringArray1");
    stringArray2.set(1, "token2FeatureStringArray2");
    stringArray2.set(2, "token2FeatureStringArray3");
    annotation2.setFeatureStringArray(stringArray2);
   
    annotation2.addToIndexes();
   
    Annotation1 annotation3 = new Annotation1(cas);
    annotation3.setBegin(14);
    annotation3.setEnd(20);
    StringArray stringArray3 = new StringArray(cas, 3);
    stringArray3.set(0, "token3FeatureStringArray1");
    stringArray3.set(1, "token3FeatureStringArray2");
    stringArray3.set(2, "token3FeatureStringArray3");
    annotation3.setFeatureStringArray(stringArray3);
    annotation3.addToIndexes();   
   
    List<String> featureNames = new ArrayList<String>();
    featureNames.add("featureStringArray");
   
    AnnotationTokenStream annotationTokenStream = new AnnotationTokenStream(cas, CAS.NAME_DEFAULT_SOFA, "org.apache.uima.lucas.indexer.types.test.Annotation1", featureNames, null);
View Full Code Here

  }
 
  @Test
  public void testCreateArrayFeatureTokensWithDelimiter() throws Exception{
    JCas cas = createCasWithText("token1 token2 token3");
    Annotation1 annotation1 = new Annotation1(cas);
    annotation1.setBegin(0);
    annotation1.setEnd(6);
    StringArray stringArray1 = new StringArray(cas, 3);
    stringArray1.set(0, "token1FeatureStringArray1");
    stringArray1.set(1, "token1FeatureStringArray2");
    stringArray1.set(2, "token1FeatureStringArray3");
    annotation1.setFeatureStringArray(stringArray1);
    annotation1.addToIndexes();
   
    Annotation1 annotation2 = new Annotation1(cas);
    annotation2.setBegin(7);
    annotation2.setEnd(13);
    StringArray stringArray2 = new StringArray(cas, 3);
    stringArray2.set(0, "token2FeatureStringArray1");
    stringArray2.set(1, "token2FeatureStringArray2");
    stringArray2.set(2, "token2FeatureStringArray3");
    annotation2.setFeatureStringArray(stringArray2);
   
    annotation2.addToIndexes();
   
    Annotation1 annotation3 = new Annotation1(cas);
    annotation3.setBegin(14);
    annotation3.setEnd(20);
    StringArray stringArray3 = new StringArray(cas, 3);
    stringArray3.set(0, "token3FeatureStringArray1");
    stringArray3.set(1, "token3FeatureStringArray2");
    stringArray3.set(2, "token3FeatureStringArray3");
    annotation3.setFeatureStringArray(stringArray3);
    annotation3.addToIndexes();   
   
    List<String> featureNames = new ArrayList<String>();
    featureNames.add("featureStringArray");
   
   
View Full Code Here

  }
 
  @Test
  public void testCreateFeatureStructureTokens() throws Exception{
    JCas cas = createCasWithText("token1 token2 token3");
    Annotation1 annotation1 = new Annotation1(cas);
    annotation1.setBegin(0);
    annotation1.setEnd(6);
    FeatureStructure1 featureStructure1 = new FeatureStructure1(cas);
    featureStructure1.setFeature1("token1Feature1");
    FeatureStructure2 featureStructure2 = new FeatureStructure2(cas);
    featureStructure2.setFeature1("token1Feature3Feature1");
    featureStructure1.setFeature3(featureStructure2);
    annotation1.setFeatureStructure1(featureStructure1);
    annotation1.addToIndexes();
   
    Annotation1 annotation2 = new Annotation1(cas);
    annotation2.setBegin(7);
    annotation2.setEnd(13);
    featureStructure1 = new FeatureStructure1(cas);
    featureStructure1.setFeature1("token2Feature1");
    featureStructure2 = new FeatureStructure2(cas);
    featureStructure2.setFeature1("token2Feature3Feature1");
    featureStructure1.setFeature3(featureStructure2);
    annotation2.setFeatureStructure1(featureStructure1);   
    annotation2.addToIndexes();
   
    Annotation1 annotation3 = new Annotation1(cas);
    annotation3.setBegin(14);
    annotation3.setEnd(20);
    featureStructure1 = new FeatureStructure1(cas);
    featureStructure1.setFeature1("token3Feature1");
    featureStructure2 = new FeatureStructure2(cas);
    featureStructure2.setFeature1("token3Feature3Feature1");
    featureStructure1.setFeature3(featureStructure2);   
    annotation3.setFeatureStructure1(featureStructure1);   
    annotation3.addToIndexes();
    List<String> featureNames = new ArrayList<String>();
    featureNames.add("feature1");
   
    AnnotationTokenStream annotationTokenStream = new AnnotationTokenStream(cas, CAS.NAME_DEFAULT_SOFA, "org.apache.uima.lucas.indexer.types.test.Annotation1", "featureStructure1", featureNames, null);
    Token nextToken = annotationTokenStream.next();
View Full Code Here

  }
 
  @Test
  public void testCreateArrayFeatureStructuresWithDelimterTokens() throws Exception{
    JCas cas = createCasWithText("token1 token2 token3");
    Annotation1 annotation1 = new Annotation1(cas);
    annotation1.setBegin(0);
    annotation1.setEnd(6);
   
    FSArray featureStructure1Array = new FSArray(cas, 3);
    FeatureStructure1 featureStructure1 = new FeatureStructure1(cas);
    featureStructure1.setFeature1("token1FeatureStructures1Feature10");
    featureStructure1.setFeature2("token1FeatureStructures1Feature20");
 
    featureStructure1Array.set(0, featureStructure1);
 
    featureStructure1 = new FeatureStructure1(cas);
    featureStructure1.setFeature1("token1FeatureStructures1Feature11");
    featureStructure1.setFeature2("token1FeatureStructures1Feature21");
   
    featureStructure1Array.set(1, featureStructure1);
 
    featureStructure1 = new FeatureStructure1(cas);
    featureStructure1.setFeature1("token1FeatureStructures1Feature12");
    featureStructure1.setFeature2("token1FeatureStructures1Feature22");
   
    featureStructure1Array.set(2, featureStructure1);
   
    annotation1.setFeatureStructures1(featureStructure1Array);
    annotation1.addToIndexes();
   
    Annotation1 annotation2 = new Annotation1(cas);
    annotation2.setBegin(7);
    annotation2.setEnd(13);
 
    featureStructure1Array = new FSArray(cas, 3);
    featureStructure1 = new FeatureStructure1(cas);
    featureStructure1.setFeature1("token2FeatureStructures1Feature10");
    featureStructure1.setFeature2("token2FeatureStructures1Feature20");
       
    featureStructure1Array.set(0, featureStructure1);
 
    featureStructure1 = new FeatureStructure1(cas);
    featureStructure1.setFeature1("token2FeatureStructures1Feature11");
    featureStructure1.setFeature2("token2FeatureStructures1Feature21");
   
    featureStructure1Array.set(1, featureStructure1);
 
    featureStructure1 = new FeatureStructure1(cas);
    featureStructure1.setFeature1("token2FeatureStructures1Feature12");
    featureStructure1.setFeature2("token2FeatureStructures1Feature22");   
   
    featureStructure1Array.set(2, featureStructure1);
   
    annotation2.setFeatureStructures1(featureStructure1Array);
    annotation2.addToIndexes();
   
    Annotation1 annotation3 = new Annotation1(cas);
    annotation3.setBegin(14);
    annotation3.setEnd(20);
   
    featureStructure1Array = new FSArray(cas, 3);
    featureStructure1 = new FeatureStructure1(cas);
    featureStructure1.setFeature1("token3FeatureStructures1Feature10");
    featureStructure1.setFeature2("token3FeatureStructures1Feature20");
   
    featureStructure1Array.set(0, featureStructure1);
 
    featureStructure1 = new FeatureStructure1(cas);
    featureStructure1.setFeature1("token3FeatureStructures1Feature11");
    featureStructure1.setFeature2("token3FeatureStructures1Feature21");
   
    featureStructure1Array.set(1, featureStructure1);
 
    featureStructure1 = new FeatureStructure1(cas);
    featureStructure1.setFeature1("token3FeatureStructures1Feature12");
    featureStructure1.setFeature2("token3FeatureStructures1Feature22");
   
    featureStructure1Array.set(2, featureStructure1);
   
    annotation3.setFeatureStructures1(featureStructure1Array);
    annotation3.addToIndexes();
 
    List<String> featureNames = new ArrayList<String>();
    featureNames.add("feature1");
    featureNames.add("feature2");
 
View Full Code Here

 
  @Test
  public void testCreateArrayFeatureStructuresWithSinleFeature() throws Exception{
      JCas cas = createCasWithText("token1 token2 token3");
      Annotation1 annotation1 = new Annotation1(cas);
      annotation1.setBegin(0);
      annotation1.setEnd(6);
     
      FSArray featureStructure1Array = new FSArray(cas, 3);
     
      FeatureStructure1 featureStructure1 = new FeatureStructure1(cas);
      featureStructure1.setFeature1("token1FeatureStructures1Feature10");
      featureStructure1Array.set(0, featureStructure1);
     
      featureStructure1 = new FeatureStructure1(cas);
      featureStructure1.setFeature1("token1FeatureStructures1Feature11");     
      featureStructure1Array.set(1, featureStructure1);

      featureStructure1 = new FeatureStructure1(cas);
      featureStructure1.setFeature1("token1FeatureStructures1Feature12");         
      featureStructure1Array.set(2, featureStructure1);
     
      annotation1.setFeatureStructures1(featureStructure1Array);
      annotation1.addToIndexes();
     
      Annotation1 annotation2 = new Annotation1(cas);
      annotation2.setBegin(7);
      annotation2.setEnd(13);

      featureStructure1Array = new FSArray(cas, 3);

      featureStructure1 = new FeatureStructure1(cas);
      featureStructure1.setFeature1("token2FeatureStructures1Feature10");     
      featureStructure1Array.set(0, featureStructure1);

      featureStructure1 = new FeatureStructure1(cas);
      featureStructure1.setFeature1("token2FeatureStructures1Feature11");     
      featureStructure1Array.set(1, featureStructure1);

      featureStructure1 = new FeatureStructure1(cas);
      featureStructure1.setFeature1("token2FeatureStructures1Feature12");
      featureStructure1Array.set(2, featureStructure1);
     
      annotation2.setFeatureStructures1(featureStructure1Array);
      annotation2.addToIndexes();
     
      Annotation1 annotation3 = new Annotation1(cas);
      annotation3.setBegin(14);
      annotation3.setEnd(20);
     
      featureStructure1Array = new FSArray(cas, 3);
      featureStructure1 = new FeatureStructure1(cas);
      featureStructure1.setFeature1("token3FeatureStructures1Feature10");
      featureStructure1Array.set(0, featureStructure1);

      featureStructure1 = new FeatureStructure1(cas);
      featureStructure1.setFeature1("token3FeatureStructures1Feature11");
      featureStructure1Array.set(1, featureStructure1);

      featureStructure1 = new FeatureStructure1(cas);
      featureStructure1.setFeature1("token3FeatureStructures1Feature12");
      featureStructure1Array.set(2, featureStructure1);
     
      annotation3.setFeatureStructures1(featureStructure1Array);
      annotation3.addToIndexes();

      List<String> featureNames = new ArrayList<String>();
      featureNames.add("feature1");
         
      AnnotationTokenStream annotationTokenStream = new AnnotationTokenStream(cas, CAS.NAME_DEFAULT_SOFA, "org.apache.uima.lucas.indexer.types.test.Annotation1", "featureStructures1", featureNames, null);
View Full Code Here

  }
 
  @Test
  public void testCreateArrayFeatureWithFeaturePath() throws Exception{   
    JCas cas = createCasWithText("token1 token2 token3");
    Annotation1 annotation1 = new Annotation1(cas);
    annotation1.setBegin(0);
    annotation1.setEnd(6);
   
    FSArray featureStructure1Array = new FSArray(cas, 3);
    FeatureStructure1 featureStructure1 = new FeatureStructure1(cas);

    FeatureStructure2 featureStructure2 = new FeatureStructure2(cas);
    featureStructure2.setFeature1("token1FeatureStructures1Feature3Feature10");
 
    featureStructure1.setFeature3(featureStructure2);
    featureStructure1Array.set(0, featureStructure1);

    featureStructure1 = new FeatureStructure1(cas);
   
    featureStructure2 = new FeatureStructure2(cas);
    featureStructure2.setFeature1("token1FeatureStructures1Feature3Feature11");

    featureStructure1.setFeature3(featureStructure2);
    featureStructure1Array.set(1, featureStructure1);

    featureStructure1 = new FeatureStructure1(cas);
   
    featureStructure2 = new FeatureStructure2(cas);
    featureStructure2.setFeature1("token1FeatureStructures1Feature3Feature12");
    featureStructure1.setFeature3(featureStructure2);
    featureStructure1Array.set(2, featureStructure1);
   
    annotation1.setFeatureStructures1(featureStructure1Array);
    annotation1.addToIndexes();
   
    Annotation1 annotation2 = new Annotation1(cas);
    annotation2.setBegin(7);
    annotation2.setEnd(13);

    featureStructure1Array = new FSArray(cas, 3);
    featureStructure1 = new FeatureStructure1(cas);
 
    featureStructure2 = new FeatureStructure2(cas);
    featureStructure2.setFeature1("token2FeatureStructures1Feature3Feature10");
   
    featureStructure1.setFeature3(featureStructure2);
    featureStructure1Array.set(0, featureStructure1);

    featureStructure1 = new FeatureStructure1(cas);
   
    featureStructure2 = new FeatureStructure2(cas);
    featureStructure2.setFeature1("token2FeatureStructures1Feature3Feature11");
   
    featureStructure1.setFeature3(featureStructure2);
    featureStructure1Array.set(1, featureStructure1);

    featureStructure1 = new FeatureStructure1(cas);
   
    featureStructure2 = new FeatureStructure2(cas);
    featureStructure2.setFeature1("token2FeatureStructures1Feature3Feature12");
   
    featureStructure1.setFeature3(featureStructure2);
    featureStructure1Array.set(2, featureStructure1);
   
    annotation2.setFeatureStructures1(featureStructure1Array);
    annotation2.addToIndexes();
   
    Annotation1 annotation3 = new Annotation1(cas);
    annotation3.setBegin(14);
    annotation3.setEnd(20);
   
    featureStructure1Array = new FSArray(cas, 3);
    featureStructure1 = new FeatureStructure1(cas);
   
    featureStructure2 = new FeatureStructure2(cas);
    featureStructure2.setFeature1("token3FeatureStructures1Feature3Feature10");
   
    featureStructure1.setFeature3(featureStructure2);
    featureStructure1Array.set(0, featureStructure1);

    featureStructure1 = new FeatureStructure1(cas);
   
    featureStructure2 = new FeatureStructure2(cas);
    featureStructure2.setFeature1("token3FeatureStructures1Feature3Feature11");
       
    featureStructure1.setFeature3(featureStructure2);
    featureStructure1Array.set(1, featureStructure1);

    featureStructure1 = new FeatureStructure1(cas);
    featureStructure1.setFeature1("token3FeatureStructures1Feature12");
    featureStructure1.setFeature2("token3FeatureStructures1Feature22");
     
    featureStructure2 = new FeatureStructure2(cas);
    featureStructure2.setFeature1("token3FeatureStructures1Feature3Feature12");
   
    featureStructure1.setFeature3(featureStructure2);
    featureStructure1Array.set(2, featureStructure1);
   
    annotation3.setFeatureStructures1(featureStructure1Array);
    annotation3.addToIndexes();

    List<String> featureNames = new ArrayList<String>();
    featureNames.add("feature1");
       
    AnnotationTokenStream annotationTokenStream = new AnnotationTokenStream(cas, CAS.NAME_DEFAULT_SOFA, "org.apache.uima.lucas.indexer.types.test.Annotation1", "featureStructures1.feature3", featureNames, null);
View Full Code Here

 
  @Test
  public void testCreateArrayFeaturesWithFeaturePathAndStringArray() throws Exception{

    JCas cas = createCasWithText("token1 token2 token3");
    Annotation1 annotation1 = new Annotation1(cas);
    annotation1.setBegin(0);
    annotation1.setEnd(6);

    FSArray featureStructure1Array = new FSArray(cas, 3);
    FeatureStructure1 featureStructure1 = new FeatureStructure1(cas);
    featureStructure1.setFeature1("token1FeatureStructures1Feature10");
    featureStructure1.setFeature2("token1FeatureStructures1Feature20");
    StringArray stringArray1 = new StringArray(cas, 3);
    stringArray1.set(0, "token1FeatureStructures1Feature3Feature3_0_0");
    stringArray1.set(1, "token1FeatureStructures1Feature3Feature3_0_1");
    stringArray1.set(2, "token1FeatureStructures1Feature3Feature3_0_2");

    FeatureStructure2 featureStructure2 = new FeatureStructure2(cas);
    featureStructure2.setFeature1("token1FeatureStructures1Feature3Feature10");
    featureStructure2.setFeature3(stringArray1);   
    featureStructure1.setFeature3(featureStructure2);
    featureStructure1Array.set(0, featureStructure1);

    featureStructure1 = new FeatureStructure1(cas);

    stringArray1 = new StringArray(cas, 3);
    stringArray1.set(0, "token1FeatureStructures1Feature3Feature3_1_0");
    stringArray1.set(1, "token1FeatureStructures1Feature3Feature3_1_1");
    stringArray1.set(2, "token1FeatureStructures1Feature3Feature3_1_2");

    featureStructure2 = new FeatureStructure2(cas);

    featureStructure2.setFeature3(stringArray1);
    featureStructure1.setFeature3(featureStructure2);
    featureStructure1Array.set(1, featureStructure1);

    featureStructure1 = new FeatureStructure1(cas);

    stringArray1 = new StringArray(cas, 3);
    stringArray1.set(0, "token1FeatureStructures1Feature3Feature3_2_0");
    stringArray1.set(1, "token1FeatureStructures1Feature3Feature3_2_1");
    stringArray1.set(2, "token1FeatureStructures1Feature3Feature3_2_2");
    featureStructure2 = new FeatureStructure2(cas);

    featureStructure2.setFeature3(stringArray1);
    featureStructure1.setFeature3(featureStructure2);
    featureStructure1Array.set(2, featureStructure1);

    annotation1.setFeatureStructures1(featureStructure1Array);
    annotation1.addToIndexes();

    Annotation1 annotation2 = new Annotation1(cas);
    annotation2.setBegin(7);
    annotation2.setEnd(13);

    featureStructure1Array = new FSArray(cas, 3);
    featureStructure1 = new FeatureStructure1(cas);

    stringArray1 = new StringArray(cas, 3);
    stringArray1.set(0, "token2FeatureStructures1Feature3Feature3_0_0");
    stringArray1.set(1, "token2FeatureStructures1Feature3Feature3_0_1");
    stringArray1.set(2, "token2FeatureStructures1Feature3Feature3_0_2");

    featureStructure2 = new FeatureStructure2(cas);
    featureStructure2.setFeature3(stringArray1);

    featureStructure1.setFeature3(featureStructure2);
    featureStructure1Array.set(0, featureStructure1);

    featureStructure1 = new FeatureStructure1(cas);

    stringArray1 = new StringArray(cas, 3);
    stringArray1.set(0, "token2FeatureStructures1Feature3Feature3_1_0");
    stringArray1.set(1, "token2FeatureStructures1Feature3Feature3_1_1");
    stringArray1.set(2, "token2FeatureStructures1Feature3Feature3_1_2");

    featureStructure2 = new FeatureStructure2(cas);
    featureStructure2.setFeature3(stringArray1);

    featureStructure1.setFeature3(featureStructure2);
    featureStructure1Array.set(1, featureStructure1);

    stringArray1 = new StringArray(cas, 3);
    stringArray1.set(0, "token2FeatureStructures1Feature3Feature3_2_0");
    stringArray1.set(1, "token2FeatureStructures1Feature3Feature3_2_1");
    stringArray1.set(2, "token2FeatureStructures1Feature3Feature3_2_2");

    featureStructure1 = new FeatureStructure1(cas);

    featureStructure2 = new FeatureStructure2(cas);
    featureStructure2.setFeature3(stringArray1);

    featureStructure1.setFeature3(featureStructure2);
    featureStructure1Array.set(2, featureStructure1);

    annotation2.setFeatureStructures1(featureStructure1Array);
    annotation2.addToIndexes();

    Annotation1 annotation3 = new Annotation1(cas);
    annotation3.setBegin(14);
    annotation3.setEnd(20);

    featureStructure1Array = new FSArray(cas, 3);
    featureStructure1 = new FeatureStructure1(cas);

    stringArray1 = new StringArray(cas, 3);
    stringArray1.set(0, "token3FeatureStructures1Feature3Feature3_0_0");
    stringArray1.set(1, "token3FeatureStructures1Feature3Feature3_0_1");
    stringArray1.set(2, "token3FeatureStructures1Feature3Feature3_0_2");

    featureStructure2 = new FeatureStructure2(cas);
    featureStructure2.setFeature3(stringArray1);

    featureStructure1.setFeature3(featureStructure2);
    featureStructure1Array.set(0, featureStructure1);

    featureStructure1 = new FeatureStructure1(cas);

    stringArray1 = new StringArray(cas, 3);
    stringArray1.set(0, "token3FeatureStructures1Feature3Feature3_1_0");
    stringArray1.set(1, "token3FeatureStructures1Feature3Feature3_1_1");
    stringArray1.set(2, "token3FeatureStructures1Feature3Feature3_1_2");   

    featureStructure2 = new FeatureStructure2(cas);
    featureStructure2.setFeature3(stringArray1);

    featureStructure1.setFeature3(featureStructure2);
    featureStructure1Array.set(1, featureStructure1);

    featureStructure1 = new FeatureStructure1(cas);

    stringArray1 = new StringArray(cas, 3);
    stringArray1.set(0, "token3FeatureStructures1Feature3Feature3_2_0");
    stringArray1.set(1, "token3FeatureStructures1Feature3Feature3_2_1");
    stringArray1.set(2, "token3FeatureStructures1Feature3Feature3_2_2");   

    featureStructure2 = new FeatureStructure2(cas);
    featureStructure2.setFeature3(stringArray1);

    featureStructure1.setFeature3(featureStructure2);
    featureStructure1Array.set(2, featureStructure1);

    annotation3.setFeatureStructures1(featureStructure1Array);
    annotation3.addToIndexes();

    List<String> featureNames = new ArrayList<String>();
    featureNames.add("feature3");

    AnnotationTokenStream annotationTokenStream = new AnnotationTokenStream(cas, CAS.NAME_DEFAULT_SOFA, "org.apache.uima.lucas.indexer.types.test.Annotation1", "featureStructures1.feature3", featureNames, null);
View Full Code Here

  }
 
  @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

  }

  @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

TOP

Related Classes of org.apache.uima.lucas.indexer.types.test.Annotation1

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.