当前位置: 首页>>代码示例>>Java>>正文


Java CASImpl类代码示例

本文整理汇总了Java中org.apache.uima.cas.impl.CASImpl的典型用法代码示例。如果您正苦于以下问题:Java CASImpl类的具体用法?Java CASImpl怎么用?Java CASImpl使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


CASImpl类属于org.apache.uima.cas.impl包,在下文中一共展示了CASImpl类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: forceSetFeatureValue

import org.apache.uima.cas.impl.CASImpl; //导入依赖的package包/类
private static void forceSetFeatureValue(FeatureStructure aFS, String aFeatureName,
        String aValue)
{
    CASImpl casImpl = (CASImpl) aFS.getCAS().getLowLevelCAS();
    TypeSystemImpl ts = (TypeSystemImpl) aFS.getCAS().getTypeSystem();
    Feature feat = aFS.getType().getFeatureByBaseName(aFeatureName);
    int featCode = ((FeatureImpl) feat).getCode();
    int thisType = ((TypeImpl) aFS.getType()).getCode();
    if (!ts.isApprop(thisType, featCode)) {
        throw new IllegalArgumentException("Feature structure does not have that feature");
    }
    if (!ts.subsumes(ts.getType(CAS.TYPE_NAME_STRING), feat.getRange())) {
        throw new IllegalArgumentException("Not a string feature!");
    }
    casImpl.ll_setStringValue(casImpl.ll_getFSRef(aFS), featCode, aValue);
}
 
开发者ID:webanno,项目名称:webanno,代码行数:17,代码来源:RemoteApiController2.java

示例2: createFS

import org.apache.uima.cas.impl.CASImpl; //导入依赖的package包/类
public FeatureStructure createFS(int addr, CASImpl cas) {
 if (GoldAspectTarget_Type.this.useExistingInstance) {
   // Return eq fs instance if already created
    FeatureStructure fs = GoldAspectTarget_Type.this.jcas.getJfsFromCaddr(addr);
    if (null == fs) {
      fs = new GoldAspectTarget(addr, GoldAspectTarget_Type.this);
   GoldAspectTarget_Type.this.jcas.putJfsFromCaddr(addr, fs);
   return fs;
    }
    return fs;
   } else return new GoldAspectTarget(addr, GoldAspectTarget_Type.this);
}
 
开发者ID:uhh-lt,项目名称:LT-ABSA,代码行数:13,代码来源:GoldAspectTarget_Type.java

示例3: createFS

import org.apache.uima.cas.impl.CASImpl; //导入依赖的package包/类
public FeatureStructure createFS(int addr, CASImpl cas) {
 if (AspectTarget_Type.this.useExistingInstance) {
   // Return eq fs instance if already created
    FeatureStructure fs = AspectTarget_Type.this.jcas.getJfsFromCaddr(addr);
    if (null == fs) {
      fs = new AspectTarget(addr, AspectTarget_Type.this);
   AspectTarget_Type.this.jcas.putJfsFromCaddr(addr, fs);
   return fs;
    }
    return fs;
   } else return new AspectTarget(addr, AspectTarget_Type.this);
}
 
开发者ID:uhh-lt,项目名称:LT-ABSA,代码行数:13,代码来源:AspectTarget_Type.java

示例4: createFS

import org.apache.uima.cas.impl.CASImpl; //导入依赖的package包/类
public FeatureStructure createFS(int addr, CASImpl cas) {
 if (CC_Type.this.useExistingInstance) {
   // Return eq fs instance if already created
    FeatureStructure fs = CC_Type.this.jcas.getJfsFromCaddr(addr);
    if (null == fs) {
      fs = new CC(addr, CC_Type.this);
   CC_Type.this.jcas.putJfsFromCaddr(addr, fs);
   return fs;
    }
    return fs;
   } else return new CC(addr, CC_Type.this);
}
 
开发者ID:UKPLab,项目名称:emnlp2017-cmapsum-corpus,代码行数:13,代码来源:CC_Type.java

示例5: createFS

import org.apache.uima.cas.impl.CASImpl; //导入依赖的package包/类
public FeatureStructure createFS(int addr, CASImpl cas) {
 if (QuestionCategoryAnnotation_Type.this.useExistingInstance) {
   // Return eq fs instance if already created
    FeatureStructure fs = QuestionCategoryAnnotation_Type.this.jcas.getJfsFromCaddr(addr);
    if (null == fs) {
      fs = new QuestionCategoryAnnotation(addr, QuestionCategoryAnnotation_Type.this);
   QuestionCategoryAnnotation_Type.this.jcas.putJfsFromCaddr(addr, fs);
   return fs;
    }
    return fs;
   } else return new QuestionCategoryAnnotation(addr, QuestionCategoryAnnotation_Type.this);
}
 
开发者ID:utk4rsh,项目名称:question-classifier,代码行数:13,代码来源:QuestionCategoryAnnotation_Type.java

示例6: SystemIndexing

import org.apache.uima.cas.impl.CASImpl; //导入依赖的package包/类
@Inject
SystemIndexing(CasProcessorFactory casProcessorFactory,
               SystemIndexCasProcessingDelegate.Factory casViewProcessorDelegateFactory,
               Provider<SystemIndexFSProcessorDelegate> systemIndexFSProcessorDelegateProvider,
               @Assisted SystemIndexingSettings systemIndexingSettings,
               @Assisted TypeSystemDescription typeSystemDescription) throws NlpTabException {
    this.casProcessorFactory = casProcessorFactory;
    this.systemIndexFSProcessorDelegateProvider = systemIndexFSProcessorDelegateProvider;

    this.systemIndexingSettings = systemIndexingSettings;

    tuningProperties = new Properties();
    tuningProperties.setProperty(UIMAFramework.JCAS_CACHE_ENABLED, "false");

    resourceManager = UIMAFramework.newDefaultResourceManager();

    CASMgr casMgr = CASFactory.createCAS(CASImpl.DEFAULT_INITIAL_HEAP_SIZE, false);
    try {
        CasCreationUtils.setupTypeSystem(casMgr, typeSystemDescription);
    } catch (ResourceInitializationException e) {
        throw new NlpTabException(e);
    }
    ((CASImpl) casMgr).commitTypeSystem();

    typeSystem = ((CASImpl) casMgr).getTypeSystem();

    TypeFilterLists typeFilterLists = TypeFilterLists.create(TYPE_WHITELIST, new String[]{});
    ImmutableSet<String> typeFilter = TypeFilterBuilder.newBuilder()
            .withTypeSystem(typeSystem)
            .withTypeFilterLists(typeFilterLists)
            .createTypeFilter();
    typeSystemInfo = new TypeSystemInfo(typeSystem, typeFilter);

    InstanceIndexes instanceIndexes = systemIndexingSettings.getInstanceIndexes();
    String systemIndex = systemIndexingSettings.getIndex();
    systemIndexCasViewProcessorDelegate = casViewProcessorDelegateFactory.create(instanceIndexes, systemIndex);
}
 
开发者ID:nlpie,项目名称:nlptab,代码行数:38,代码来源:SystemIndexing.java

示例7: createFS

import org.apache.uima.cas.impl.CASImpl; //导入依赖的package包/类
public FeatureStructure createFS(int addr, CASImpl cas) {
 if (SwanLink_Type.this.useExistingInstance) {
   // Return eq fs instance if already created
    FeatureStructure fs = SwanLink_Type.this.jcas.getJfsFromCaddr(addr);
    if (null == fs) {
      fs = new SwanLink(addr, SwanLink_Type.this);
   SwanLink_Type.this.jcas.putJfsFromCaddr(addr, fs);
   return fs;
    }
    return fs;
   } else return new SwanLink(addr, SwanLink_Type.this);
}
 
开发者ID:annefried,项目名称:swan,代码行数:13,代码来源:SwanLink_Type.java

示例8: createFS

import org.apache.uima.cas.impl.CASImpl; //导入依赖的package包/类
public FeatureStructure createFS(int addr, CASImpl cas) {
 if (SwanLabel_Type.this.useExistingInstance) {
   // Return eq fs instance if already created
    FeatureStructure fs = SwanLabel_Type.this.jcas.getJfsFromCaddr(addr);
    if (null == fs) {
      fs = new SwanLabel(addr, SwanLabel_Type.this);
   SwanLabel_Type.this.jcas.putJfsFromCaddr(addr, fs);
   return fs;
    }
    return fs;
   } else return new SwanLabel(addr, SwanLabel_Type.this);
}
 
开发者ID:annefried,项目名称:swan,代码行数:13,代码来源:SwanLabel_Type.java

示例9: createFS

import org.apache.uima.cas.impl.CASImpl; //导入依赖的package包/类
public FeatureStructure createFS(int addr, CASImpl cas) {
 if (SwanAnnotation_Type.this.useExistingInstance) {
   // Return eq fs instance if already created
    FeatureStructure fs = SwanAnnotation_Type.this.jcas.getJfsFromCaddr(addr);
    if (null == fs) {
      fs = new SwanAnnotation(addr, SwanAnnotation_Type.this);
   SwanAnnotation_Type.this.jcas.putJfsFromCaddr(addr, fs);
   return fs;
    }
    return fs;
   } else return new SwanAnnotation(addr, SwanAnnotation_Type.this);
}
 
开发者ID:annefried,项目名称:swan,代码行数:13,代码来源:SwanAnnotation_Type.java

示例10: createFS

import org.apache.uima.cas.impl.CASImpl; //导入依赖的package包/类
public FeatureStructure createFS(int addr, CASImpl cas) {
 if (VerbFeatures_Type.this.useExistingInstance) {
   // Return eq fs instance if already created
    FeatureStructure fs = VerbFeatures_Type.this.jcas.getJfsFromCaddr(addr);
    if (null == fs) {
      fs = new VerbFeatures(addr, VerbFeatures_Type.this);
   VerbFeatures_Type.this.jcas.putJfsFromCaddr(addr, fs);
   return fs;
    }
    return fs;
   } else return new VerbFeatures(addr, VerbFeatures_Type.this);
}
 
开发者ID:annefried,项目名称:sitent,代码行数:13,代码来源:VerbFeatures_Type.java

示例11: createFS

import org.apache.uima.cas.impl.CASImpl; //导入依赖的package包/类
public FeatureStructure createFS(int addr, CASImpl cas) {
 if (SEFeature_Type.this.useExistingInstance) {
   // Return eq fs instance if already created
    FeatureStructure fs = SEFeature_Type.this.jcas.getJfsFromCaddr(addr);
    if (null == fs) {
      fs = new SEFeature(addr, SEFeature_Type.this);
   SEFeature_Type.this.jcas.putJfsFromCaddr(addr, fs);
   return fs;
    }
    return fs;
   } else return new SEFeature(addr, SEFeature_Type.this);
}
 
开发者ID:annefried,项目名称:sitent,代码行数:13,代码来源:SEFeature_Type.java

示例12: createFS

import org.apache.uima.cas.impl.CASImpl; //导入依赖的package包/类
public FeatureStructure createFS(int addr, CASImpl cas) {
 if (Passage_Type.this.useExistingInstance) {
   // Return eq fs instance if already created
    FeatureStructure fs = Passage_Type.this.jcas.getJfsFromCaddr(addr);
    if (null == fs) {
      fs = new Passage(addr, Passage_Type.this);
   Passage_Type.this.jcas.putJfsFromCaddr(addr, fs);
   return fs;
    }
    return fs;
   } else return new Passage(addr, Passage_Type.this);
}
 
开发者ID:annefried,项目名称:sitent,代码行数:13,代码来源:Passage_Type.java

示例13: createFS

import org.apache.uima.cas.impl.CASImpl; //导入依赖的package包/类
public FeatureStructure createFS(int addr, CASImpl cas) {
 if (Segment_Type.this.useExistingInstance) {
   // Return eq fs instance if already created
    FeatureStructure fs = Segment_Type.this.jcas.getJfsFromCaddr(addr);
    if (null == fs) {
      fs = new Segment(addr, Segment_Type.this);
   Segment_Type.this.jcas.putJfsFromCaddr(addr, fs);
   return fs;
    }
    return fs;
   } else return new Segment(addr, Segment_Type.this);
}
 
开发者ID:annefried,项目名称:sitent,代码行数:13,代码来源:Segment_Type.java

示例14: createFS

import org.apache.uima.cas.impl.CASImpl; //导入依赖的package包/类
public FeatureStructure createFS(int addr, CASImpl cas) {
 if (ClassificationAnnotation_Type.this.useExistingInstance) {
   // Return eq fs instance if already created
    FeatureStructure fs = ClassificationAnnotation_Type.this.jcas.getJfsFromCaddr(addr);
    if (null == fs) {
      fs = new ClassificationAnnotation(addr, ClassificationAnnotation_Type.this);
   ClassificationAnnotation_Type.this.jcas.putJfsFromCaddr(addr, fs);
   return fs;
    }
    return fs;
   } else return new ClassificationAnnotation(addr, ClassificationAnnotation_Type.this);
}
 
开发者ID:annefried,项目名称:sitent,代码行数:13,代码来源:ClassificationAnnotation_Type.java

示例15: createFS

import org.apache.uima.cas.impl.CASImpl; //导入依赖的package包/类
public FeatureStructure createFS(int addr, CASImpl cas) {
 if (Situation_Type.this.useExistingInstance) {
   // Return eq fs instance if already created
    FeatureStructure fs = Situation_Type.this.jcas.getJfsFromCaddr(addr);
    if (null == fs) {
      fs = new Situation(addr, Situation_Type.this);
   Situation_Type.this.jcas.putJfsFromCaddr(addr, fs);
   return fs;
    }
    return fs;
   } else return new Situation(addr, Situation_Type.this);
}
 
开发者ID:annefried,项目名称:sitent,代码行数:13,代码来源:Situation_Type.java


注:本文中的org.apache.uima.cas.impl.CASImpl类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。