Package org.apache.uima.analysis_engine

Examples of org.apache.uima.analysis_engine.AnalysisEngine.newCAS()


  @Test
  public void testImportTypeFromDefaultTypesystem() throws Exception {
    AnalysisEngine ae = createAE(NAMESPACE + "/" + NAME + "ImportTypeFromDefaultTypeSystem", true);
    try {
      CAS cas = ae.newCAS();
      cas.setDocumentText("Word");
      ae.process(cas);

      assertEquals(Arrays.asList("Word"), selectText(cas, "org.apache.uima.ruta.Type1"));
    } finally {
View Full Code Here


  @Test
  public void testUnimportedTypesAreNotResolved() throws Exception {
    AnalysisEngine ae = createAE(NAMESPACE + "/" + NAME + "UnimportedTypesAreNotResolved", true);
    try {
      CAS cas = ae.newCAS();
      cas.setDocumentText("Word");
      ae.process(cas);

      fail("Type2 should not be resolved because it is not imported.");
    } catch (AnalysisEngineProcessException e) {
View Full Code Here

  @Test
  public void testImportTypeAs() throws Exception {
    AnalysisEngine ae = createAE(NAMESPACE + "/" + NAME + "ImportTypeAs", true);
    try {
      CAS cas = ae.newCAS();
      cas.setDocumentText("First Second");
      ae.process(cas);

      assertEquals(Arrays.asList("First"), selectText(cas, "org.apache.uima.ruta.Type1"));
      assertEquals(Arrays.asList("Second"), selectText(cas, "org.apache.uima.ruta.Type2"));
View Full Code Here

  @Test
  public void testImportTypeAsStrictModeOff() throws Exception {
    AnalysisEngine ae = createAE(NAMESPACE + "/" + NAME + "ImportTypeAs", false);
    try {
      CAS cas = ae.newCAS();
      cas.setDocumentText("First Second");
      ae.process(cas);

      assertEquals(Arrays.asList("First"), selectText(cas, "org.apache.uima.ruta.Type1"));
      assertEquals(Arrays.asList("Second"), selectText(cas, "org.apache.uima.ruta.Type2"));
View Full Code Here

  @Test
  public void testImportStarFromTypeSystem() throws Exception {
    AnalysisEngine ae = createAE(NAMESPACE + "/" + NAME + "ImportStarFromTypeSystem", true);
    try {
      CAS cas = ae.newCAS();
      cas.setDocumentText("First Second");
      ae.process(cas);

      assertEquals(Arrays.asList("First"), selectText(cas, "org.apache.uima.ruta.Type1"));
      assertEquals(Arrays.asList("Second"), selectText(cas, "org.apache.uima.ruta.Type2"));
View Full Code Here

  @Test
  public void testImportPackageFromTypeSystem() throws Exception {
    AnalysisEngine ae = createAE(NAMESPACE + "/" + NAME + "ImportPackageFromTypeSystem", true);
    try {
      CAS cas = ae.newCAS();
      cas.setDocumentText("First Second");
      ae.process(cas);

      assertEquals(Arrays.asList("First"), selectText(cas, "org.apache.uima.ruta.other.Type1"));
      assertEquals(Arrays.asList("Second"), selectText(cas, "org.apache.uima.ruta.other.Type2"));
View Full Code Here

  @Test
  public void testImportPackageAliasFromTypeSystem() throws Exception {
    AnalysisEngine ae = createAE(NAMESPACE + "/" + NAME + "ImportPackageAliasFromTypeSystem", true);
    try {
      CAS cas = ae.newCAS();
      cas.setDocumentText("First Second");
      ae.process(cas);

      assertEquals(Arrays.asList("First"), selectText(cas, "org.apache.uima.ruta.other.Type1"));
      assertEquals(Arrays.asList("Second"), selectText(cas, "org.apache.uima.ruta.other2.Type1"));
View Full Code Here

  @Test
  public void testImportPackageAsWhenStrictModeIsOff() throws Exception {
    AnalysisEngine ae = createAE(NAMESPACE + "/" + NAME + "ImportPackageAs", false);
    try {
      CAS cas = ae.newCAS();
      cas.setDocumentText("First Second");
      ae.process(cas);

      assertEquals(Arrays.asList("First"), selectText(cas, "org.apache.uima.ruta.Type1"));
      assertEquals(Arrays.asList("Second"), selectText(cas, "org.apache.uima.ruta.Type2"));
View Full Code Here

  @Test
  public void testImportPackageFromCasTypeSystem() throws Exception {
    AnalysisEngine ae = createAE(NAMESPACE + "/" + NAME + "ImportPackageFromCasTypeSystem", true);
    try {
      CAS cas = ae.newCAS();
      cas.setDocumentText("First Second");
      ae.process(cas);

      assertEquals(Arrays.asList("First"), selectText(cas, "org.apache.uima.ruta.other.Type1"));
      assertEquals(Arrays.asList("Second"), selectText(cas, "org.apache.uima.ruta.other2.Type1"));
View Full Code Here

  @Test
  public void testImportAllPackagesFromTypeSystem() throws Exception {
    AnalysisEngine ae = createAE(NAMESPACE + "/" + NAME + "ImportAllPackagesFromTypeSystem", true);
    try {
      CAS cas = ae.newCAS();
      cas.setDocumentText("First Second");
      ae.process(cas);

      assertEquals(Arrays.asList("First"), selectText(cas, "org.apache.uima.ruta.other3.Type1"));
      assertEquals(Arrays.asList("Second"), selectText(cas, "org.apache.uima.ruta.other4.Type2"));
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.