Package at.ofai.gate.virtualdocuments

Examples of at.ofai.gate.virtualdocuments.AnnotatedDocumentTransformer


        processingOptions.remove("separator");
      }
    }
    try {
      annotatedDocumentTransformer =
        new AnnotatedDocumentTransformer(
        getAnnotationSpecifications(), processingOptions,
        false, true);
    } catch (InvalidNameException ex) {
      throw new ExecutionException(ex);
    }
View Full Code Here


        processingOptions.remove("separator");
      }
    }
    try {
      annotatedDocumentTransformer =
        new AnnotatedDocumentTransformer(
        getAnnotationSpecifications(), processingOptions,
        false, true);
    } catch (InvalidNameException ex) {
      throw new ExecutionException(ex);
    }
View Full Code Here

    annSpecs.add("Lookup.majorType");
    annSpecs.add("Token.string");
    FeatureMap procSpecs = Factory.newFeatureMap();
    procSpecs.put("separator"," ");

    AnnotatedDocumentTransformer adt =
            new AnnotatedDocumentTransformer(annSpecs,procSpecs,true,true);
    String theString1 = adt.getStringForDocument(testDoc01In,"");
    assertEquals("time_modifier is a simple test document for testing the PN class . stop contains token annotations in the default annotation set from person_first and some additional manual annotations .", theString1);

    OffsetMapping bom = adt.getBackwardOffsetMap();
    OffsetMapping fom = adt.getForwardOffsetMap();
    // test some backward mappings
    assertEquals("Backward mapping of 'is' start - start offset", 5, bom.getFrom(14));
    assertEquals("Backward mapping of 'is' start - end offset", 7, bom.getTo(14));
    assertEquals("Backward mapping of 'is' end - start offset", 5, bom.getFrom(15));
    assertEquals("Backward mapping of 'is' end - end offset", 7, bom.getTo(15));
    adt.getForwardOffsetMap();
  }
View Full Code Here

    FeatureMap procSpecs = Factory.newFeatureMap();
    procSpecs.put("separator","/");
    procSpecs.put("terminator","EOL");
    //procSpecs.add("separatorKeyValue==");

    AnnotatedDocumentTransformer adt =
            new AnnotatedDocumentTransformer(annSpecs,procSpecs,false,false);
    String theString1 = adt.getStringForDocument(testDoc01In,"");
    assertEquals("time_modifier/PN/stop/person_firstEOL", theString1);
  }
View Full Code Here

    annSpecs.add("Person->CONSTANT");
    FeatureMap procSpecs = Factory.newFeatureMap();
    procSpecs.put("separator"," ");
    procSpecs.put("separatorKeyValue","=");

    AnnotatedDocumentTransformer adt =
            new AnnotatedDocumentTransformer(annSpecs,procSpecs,false,false);
    String theString1 = adt.getStringForDocument(testDoc01In,"");
    assertEquals("Lookup.majorType=time_modifier Unknown.kind=PN Lookup.majorType=stop Lookup.majorType=person_first", theString1);
  }
View Full Code Here

    annSpecs.add("Lookup.majorType");
    annSpecs.add("Person->CONSTANT");
    FeatureMap procSpecs = Factory.newFeatureMap();
    procSpecs.put("separator",",");

    AnnotatedDocumentTransformer adt =
            new AnnotatedDocumentTransformer(annSpecs,procSpecs,false,false);
    String theString1 = adt.getStringForDocument(testDoc01In,"");
    assertEquals("time_modifier,PN,stop,FirstName", theString1);
  }
View Full Code Here

    procSpecs.put("separator", ",");
    procSpecs.put("separatorSame", ";");
    procSpecs.put("separatorKeyValue", "=");
    procSpecs.put("takeOverlapping","true");

    AnnotatedDocumentTransformer adt =
            new AnnotatedDocumentTransformer(annSpecs,procSpecs,false,false);
    String theString1 = adt.getStringForDocument(testDoc01In,"");
    assertEquals("Lookup.majorType=time_modifier,WhatClass=AnnotatedDocumentTranformer class,ClassWord=class,Lookup.majorType=stop,FirstPerson.rule=FirstName", theString1);
  }
View Full Code Here

    procSpecs.put("separator", ",");
    procSpecs.put("separatorSame", ";");
    procSpecs.put("separatorKeyValue", "=");
    procSpecs.put("takeAll", "true");

    AnnotatedDocumentTransformer adt =
            new AnnotatedDocumentTransformer(annSpecs,procSpecs,false,false);
    String theString1 = adt.getStringForDocument(testDoc01In,"");
    assertEquals("Lookup.majorType=time_modifier,WhatClass=AnnotatedDocumentTranformer class;ClassName=AnnotatedDocumentTranformer;Unknown.kind=PN,ClassWord=class,Lookup.majorType=stop,FirstPerson.rule=FirstName;Person.rule1=GazPersonFirst;Lookup.majorType=person_first;Person=CONSTANT", theString1);
  }
View Full Code Here

    annSpecs.add("SpaceToken-> ");
    annSpecs.add("@STRING");
    FeatureMap procSpecs = Factory.newFeatureMap();
    procSpecs.put("separator","");

    AnnotatedDocumentTransformer adt =
            new AnnotatedDocumentTransformer(annSpecs,procSpecs,false,false);
    String theString1 = adt.getStringForDocument(testDoc01In,"");
    assertEquals("time_modifier is a simple test document for testing the AnnotatedDocumentTranformer class. stop contains token annotations in the default annotation set from CONSTANT and some additional manual annotations.", theString1);
  }
View Full Code Here

    annSpecs.add("Person->CONSTANT");
    annSpecs.add("Lookup.majorType");
    FeatureMap procSpecs = Factory.newFeatureMap();
    procSpecs.put("separator","");

    AnnotatedDocumentTransformer adt =
            new AnnotatedDocumentTransformer(annSpecs,procSpecs,true,true);
    String theString1 = adt.getStringForDocument(testDoc01In,"");
    System.out.println("String: >"+theString1+"<");
    System.out.println("Forward offset map: "+adt.getForwardOffsetMap());
    System.out.println("Backward offset map: "+adt.getBackwardOffsetMap());
  }
View Full Code Here

TOP

Related Classes of at.ofai.gate.virtualdocuments.AnnotatedDocumentTransformer

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.