本文整理匯總了Java中org.apache.uima.cas.CAS.addFsToIndexes方法的典型用法代碼示例。如果您正苦於以下問題:Java CAS.addFsToIndexes方法的具體用法?Java CAS.addFsToIndexes怎麽用?Java CAS.addFsToIndexes使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.apache.uima.cas.CAS
的用法示例。
在下文中一共展示了CAS.addFsToIndexes方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: adaptFile
import org.apache.uima.cas.CAS; //導入方法依賴的package包/類
@Override
public void adaptFile(CAS cas, Path path) throws CollectionException {
LOGGER.info("Deserializing an input stream into a cas");
try (InputStream inputStream = Files.newInputStream(path)) {
XmiCasDeserializer.deserialize(inputStream, cas,
!(failOnUnknownType == null || failOnUnknownType));
} catch (SAXException | IOException e) {
LOGGER.error("Failed on document: {}", path);
throw new CollectionException(e);
}
if (addDocumentId != null && addDocumentId) {
CAS metadata = cas.getView("metadata");
Type idType = metadata.getTypeSystem()
.getType("edu.umn.biomedicus.uima.type1_5.DocumentId");
Feature idFeat = idType.getFeatureByBaseName("documentId");
FeatureStructure fs = metadata.createFS(idType);
fs.setStringValue(idFeat, path.getFileName().toString());
metadata.addFsToIndexes(fs);
}
}
示例2: process
import org.apache.uima.cas.CAS; //導入方法依賴的package包/類
@Override
public void process(CAS aCAS) throws AnalysisEngineProcessException {
LOGGER.debug("Annotating rtf paragraphs.");
CAS systemView = aCAS.getView(Views.SYSTEM_VIEW);
Type newParagraphType = systemView.getTypeSystem()
.getType("edu.umn.biomedicus.rtfuima.type.NewParagraph");
Type paragraphType = systemView.getTypeSystem()
.getType("edu.umn.biomedicus.type.ParagraphAnnotation");
AnnotationIndex<AnnotationFS> newParagraphIndex = systemView
.getAnnotationIndex(newParagraphType);
int start = 0;
for (AnnotationFS newParagraph : newParagraphIndex) {
int end = newParagraph.getEnd();
systemView.addFsToIndexes(
systemView.createAnnotation(paragraphType, start, end));
start = end;
}
}
示例3: createTokenAnnotation
import org.apache.uima.cas.CAS; //導入方法依賴的package包/類
private void createTokenAnnotation(CAS cas, int start, int end)
{
AnnotationFS tokenAnno = cas.createAnnotation(tokenType, start, end);
cas.addFsToIndexes(tokenAnno);
}