Examples of Annotation1


Examples of com.hp.hpl.jena.sdb.core.Annotation1

    }
   
    private SqlCoalesce(SDBRequest request, String alias, SqlJoin join, Set<Var> coalesceVars)
    {
        this(alias, join, coalesceVars) ;
        Annotation1 annotation = new Annotation1(true) ;
       
        // ScopeCoalesce needed
        // Scope is:
        // new ScopeRename(oldScope, renames) ;
        // And ScopeBase ==> ScopeTable.
       
        idScope = new ScopeRename(join.getIdScope()) ;
        nodeScope = new ScopeRename(join.getNodeScope()) ;
        SqlTable table = new SqlTable(alias) ;
       
        nonCoalesceVars = SetUtils.difference(join.getIdScope().getVars(),
                                              coalesceVars) ;

        // In layout1, NodeScope is the same as IdScope
//        if ( join.getNodeScope().getVars().size() != 0 )
//            LoggerFactory.getLogger(SqlCoalesce.class).warn("NodeScope is not empty") ;
       
        for ( Var v : coalesceVars )
        {
            String sqlColName = request.genId(AliasBase) ;
            SqlColumn col = new SqlColumn(table, sqlColName) ;
            idScope.setAlias(v, col) ;
            annotation.addAnnotation(v+" as "+col) ;
            // TODO Value
        }
       
        // Aliases.
        // Not coalesce variables.
        for ( Var v : nonCoalesceVars )
        {
            if ( coalesceVars.contains(v) )
            {
                LoggerFactory.getLogger(SqlCoalesce.class).warn("Variable in coalesce and non-coalesce sets: "+v) ;
                continue ;
            }
            String sqlColName = request.genId(AliasBase) ;
            SqlColumn col = new SqlColumn(table, sqlColName) ;
            idScope.setAlias(v, col) ;
            annotation.addAnnotation(v+" as "+col) ;
            // TODO Value
        }
        annotation.setAnnotation(this) ;
    }
View Full Code Here

Examples of com.hp.hpl.jena.sdb.core.Annotation1

    }
   
    private SqlCoalesce(SDBRequest request, String alias, SqlJoin join, Set<Var> coalesceVars)
    {
        this(alias, join, coalesceVars) ;
        Annotation1 annotation = new Annotation1(true) ;
       
        // ScopeCoalesce needed
        // Scope is:
        // new ScopeRename(oldScope, renames) ;
        // And ScopeBase ==> ScopeTable.
       
        idScope = new ScopeRename(join.getIdScope()) ;
        nodeScope = new ScopeRename(join.getNodeScope()) ;
        SqlTable table = new SqlTable(alias) ;
       
        nonCoalesceVars = SetUtils.difference(join.getIdScope().getVars(),
                                              coalesceVars) ;

        // In layout1, NodeScope is the same as IdScope
//        if ( join.getNodeScope().getVars().size() != 0 )
//            LoggerFactory.getLogger(SqlCoalesce.class).warn("NodeScope is not empty") ;
       
        for ( Var v : coalesceVars )
        {
            String sqlColName = request.genId(AliasBase) ;
            SqlColumn col = new SqlColumn(table, sqlColName) ;
            idScope.setAlias(v, col) ;
            annotation.addAnnotation(v+" as "+col) ;
            // TODO Value
        }
       
        // Aliases.
        // Not coalesce variables.
        for ( Var v : nonCoalesceVars )
        {
            if ( coalesceVars.contains(v) )
            {
                LoggerFactory.getLogger(SqlCoalesce.class).warn("Variable in coalesce and non-coalesce sets: "+v) ;
                continue ;
            }
            String sqlColName = request.genId(AliasBase) ;
            SqlColumn col = new SqlColumn(table, sqlColName) ;
            idScope.setAlias(v, col) ;
            annotation.addAnnotation(v+" as "+col) ;
            // TODO Value
        }
        annotation.setAnnotation(this) ;
    }
View Full Code Here

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

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

 
 
  @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

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

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

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

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

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

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

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

 
  @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

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

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

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

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