本文整理汇总了Java中org.apache.uima.fit.util.FSCollectionFactory类的典型用法代码示例。如果您正苦于以下问题:Java FSCollectionFactory类的具体用法?Java FSCollectionFactory怎么用?Java FSCollectionFactory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
FSCollectionFactory类属于org.apache.uima.fit.util包,在下文中一共展示了FSCollectionFactory类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: extract
import org.apache.uima.fit.util.FSCollectionFactory; //导入依赖的package包/类
@Override
public List<Feature> extract(JCas view, Annotation focusAnnotation)
throws CleartkExtractorException {
Word focusWord = PUtils.getWordAnno(view, focusAnnotation);
if (focusWord == null || focusWord.getWordforms() == null) {
return ImmutableList.of();
}
Collection<Wordform> wfs = FSCollectionFactory.create(focusWord.getWordforms(),
Wordform.class);
Set<String> lemmas = Sets.newHashSet();
for (Wordform wf : wfs) {
if (wf.getLemma() != null) {
lemmas.add(wf.getLemma());
}
}
return Lists.newArrayList(Collections2.transform(lemmas, lemma2Feature));
}
开发者ID:textocat,项目名称:textokit-core,代码行数:18,代码来源:LemmaFeatureExtractor.java
示例2: extract
import org.apache.uima.fit.util.FSCollectionFactory; //导入依赖的package包/类
@Override
public List<Feature> extract(JCas view, Annotation focusAnnotation)
throws CleartkExtractorException {
Word wordAnno = PUtils.getWordAnno(view, focusAnnotation);
if (wordAnno == null || wordAnno.getWordforms() == null) {
return ImmutableList.of();
}
Collection<Wordform> wfs = FSCollectionFactory.create(
wordAnno.getWordforms(), Wordform.class);
if (wfs.isEmpty()) {
return ImmutableList.of();
}
Wordform wf = wfs.iterator().next();
BitSet wfBits = toGramBits(gramModel, FSUtils.toList(wf.getGrammems()));
wfBits.and(filterBS);
List<Feature> result = Lists.newArrayList();
for (int i = wfBits.nextSetBit(0); i >= 0; i = wfBits.nextSetBit(i + 1)) {
result.add(new Feature(featureName, gramModel.getGrammem(i).getId()));
}
return result;
}
开发者ID:textocat,项目名称:textokit-core,代码行数:22,代码来源:GrammemeExtractor.java
示例3: addParse
import org.apache.uima.fit.util.FSCollectionFactory; //导入依赖的package包/类
@Override
public TreebankNode addParse(
JCas jCas,
Parse parse,
SENTENCE_TYPE sentence,
List<TOKEN_TYPE> tokens) {
TopTreebankNode node = new TopTreebankNode(jCas);
this.setAttributes(node, parse, null, jCas);
node.addToIndexes();
StringBuffer sb = new StringBuffer();
parse.show(sb);
node.setTreebankParse(sb.toString());
List<TreebankNode> terminals = getTerminals(node);
node.setTerminals(new FSArray(jCas, terminals.size()));
FSCollectionFactory.fillArrayFS(node.getTerminals(), terminals);
return node;
}
开发者ID:ClearTK,项目名称:cleartk,代码行数:20,代码来源:DefaultOutputTypesHelper.java
示例4: makePredicate
import org.apache.uima.fit.util.FSCollectionFactory; //导入依赖的package包/类
Predicate makePredicate() {
if (this.predicateToken == null) {
throw new RuntimeException("no predicateToken found yet");
}
Predicate predicate = new Predicate(
jCas,
this.predicateToken.getBegin(),
this.predicateToken.getEnd());
predicate.setAnnotation(this.predicateToken);
predicate.setArguments(new FSArray(jCas, this.arguments.size()));
FSCollectionFactory.fillArrayFS(predicate.getArguments(), this.arguments);
predicate.setBaseForm(this.baseForm);
predicate.addToIndexes();
return predicate;
}
开发者ID:ClearTK,项目名称:cleartk,代码行数:17,代码来源:Conll2005GoldAnnotator.java
示例5: convert
import org.apache.uima.fit.util.FSCollectionFactory; //导入依赖的package包/类
/**
* Convert to ClearTK <em>Predicate</em> / <em>SemanticArgument</em> annotations and add them to
* <b>view</b>.
*
* @param view
* the view where the annotations should be added
* @param topNode
* the top node annotation of the corresponding Treebank parse
* @param sentence
* the sentence annotation of the corresponding sentence
* @return the generated <em>Predicate</em> annotation
*/
public Predicate convert(JCas view, TopTreebankNode topNode, Sentence sentence) {
Predicate p = new Predicate(view);
p.setPropTxt(this.propTxt);
p.setAnnotation(this.terminal.convert(view, topNode));
p.setBegin(p.getAnnotation().getBegin());
p.setEnd(p.getAnnotation().getEnd());
p.setSentence(sentence);
p.setFrameSet(this.frameSet);
p.setBaseForm(this.baseForm);
List<Argument> aList = new ArrayList<Argument>();
for (Proplabel proplabel : this.proplabels) {
aList.add(proplabel.convert(view, topNode));
}
p.setArguments(new FSArray(view, aList.size()));
FSCollectionFactory.fillArrayFS(p.getArguments(), aList);
p.addToIndexes();
return p;
}
开发者ID:ClearTK,项目名称:cleartk,代码行数:33,代码来源:Propbank.java
示例6: addParse
import org.apache.uima.fit.util.FSCollectionFactory; //导入依赖的package包/类
@Override
public TopTreebankNode addParse(
JCas jCas,
Tree<String> berkeleyNode,
SENTENCE_TYPE sentence,
List<TOKEN_TYPE> tokens) {
List<TerminalTreebankNode> leafNodes = new ArrayList<TerminalTreebankNode>();
TopTreebankNode topNode = (TopTreebankNode) convertNode(
jCas,
berkeleyNode,
tokens,
new TokenIndex(),
leafNodes,
true);
topNode.setTerminals(new FSArray(jCas, leafNodes.size()));
FSCollectionFactory.fillArrayFS(topNode.getTerminals(), leafNodes);
topNode.addToIndexes();
return topNode;
}
开发者ID:ClearTK,项目名称:cleartk,代码行数:20,代码来源:DefaultOutputTypesHelper.java
示例7: cleanup
import org.apache.uima.fit.util.FSCollectionFactory; //导入依赖的package包/类
public static List<CandidateAnswerVariant> cleanup(JCas jcas, List<CandidateAnswerVariant> cavs,
Set<String> filteredStrings) {
return cavs.stream().map(cav -> {
if (TypeUtil.getCandidateAnswerVariantNames(cav).stream().anyMatch(Objects::isNull))
LOG.warn("Found CAVs with null names: {}", cav);
List<String> names = TypeUtil.getCandidateAnswerVariantNames(cav).stream()
.filter(v -> !filteredStrings.contains(v.toLowerCase())).collect(toList());
if (names.isEmpty())
return null;
cav.setNames(FSCollectionFactory.createStringList(jcas, names));
return cav;
} ).filter(Objects::nonNull).collect(toList());
}
开发者ID:oaqa,项目名称:bioasq,代码行数:14,代码来源:CavUtil.java
示例8: convertDenotationToConcept
import org.apache.uima.fit.util.FSCollectionFactory; //导入依赖的package包/类
private static Concept convertDenotationToConcept(JCas jcas,
PubAnnotation.Denotation denotation) {
String[] objSegs = denotation.getObj().split(":", 2);
ConceptType ctype = TypeFactory.createConceptType(jcas, "tmtool:" + objSegs[0]);
ConceptMention cmention = convertSpanToConceptMention(jcas, denotation.getSpan());
Concept concept = TypeFactory.createConcept(jcas, cmention, ctype);
if (objSegs.length > 1) {
concept.setIds(
FSCollectionFactory.createStringList(jcas, Collections.singletonList(objSegs[1])));
}
return concept;
}
开发者ID:oaqa,项目名称:bioasq,代码行数:13,代码来源:PubAnnotationConvertUtil.java
示例9: process
import org.apache.uima.fit.util.FSCollectionFactory; //导入依赖的package包/类
@Override
public void process(JCas jcas) throws AnalysisEngineProcessException {
sb = new StringBuilder();
queryWords = new HashSet<String>();
AbstractQuery aquery = TypeUtil.getAbstractQueries(jcas).stream().findFirst().get();
StringBuilder question = new StringBuilder();
question.append(TypeUtil.getQuestion(jcas).getText().toLowerCase().replaceAll("\\p{P}", " "));
for(QueryConcept q:FSCollectionFactory.create(aquery.getConcepts(), QueryConcept.class)){
question.append(" ");
question.append(bopQueryStringConstructor.formatQueryText(q).toLowerCase().replaceAll("\\p{P}", " "));
question.append(" ");
}
Set<String> stopWords = new HashSet<String>(Arrays.asList("or", "emerging", "gold", "being", "text", "global", "mainly", "affect", "oldest", "mining", "alignment", "style", "depended", "recommended", "forms", "to", "treatment", "rich", "main", "do", "affected", "diseases", "food", "could", "safe", "possible", "preferred", "effects", "during", "association", "loss", "modifications", "necessary", "cause", "reduces", "list", "identified", "events", "benefit", "common", "found", "where", "because", "be", "undergoes", "reduce", "prediction", "related", "detection", "frequency", "coss", "are", "images", "depression", "concern", "incontinence", "what", "detect", "for", "pattern", "increase", "models", "does", "health", "between", "newly", "conditions", "mode", "available", "model", "we", "targeted", "analysed", "standard", "reported", "selective", "formation", "analyses", "by", "both", "protect", "benefits", "most", "healthy", "involved", "study", "transition", "commonly", "trial", "preferentially", "action", "advantages", "changes", "top", "frequent", "repair", "major", "computational", "useful", "functional", "down", "underexpression", "defects", "determine", "implicated", "array", "tools", "approximately", "use", "basis", "create", "there", "system", "been", "screened", "their", "intermediate", "treat", "was", "function", "disorder", "life", "families", "that", "bladder", "failure", "favorable", "automated", "known", "encoded", "technologies", "promote", "with", "present", "population", "plants", "states", "has", "embedded", "work", "value", "aim", "patients", "can", "of", "flashes", "region", "examples", "and", "associated", "give", "process", "is", "describe", "binding", "it", "an", "sample", "as", "have", "in", "technology", "any", "approved", "high", "functions", "united", "administration", "mechanism", "how", "hot", "role", "take", "which", "test", "gate", "many", "goat", "used", "altered", "normal", "may", "why", "after", "problems", "shown", "hand", "applications", "chance", "important", "mass", "cleared", "response", "structure", "a", "lead", "effective", "expression", "average", "disease", "analysis", "solve", "quantitative", "the", "sequence", "enrichment"));
Set<String> sqlWords = new HashSet<String>(Arrays.asList("a","abort","abs","absolute","access","action","ada","add","admin","after","aggregate","alias","all","allocate","also","alter","always","analyse","analyze","and","any","are","array","as","asc","asensitive","assertion","assignment","asymmetric","at","atomic","attribute","attributes","audit","authorization","auto_increment","avg","avg_row_length","backup","backward","before","begin","bernoulli","between","bigint","binary","bit","bit_length","bitvar","blob","bool","boolean","both","breadth","break","browse","bulk","by","c","cache","call","called","cardinality","cascade","cascaded","case","cast","catalog","catalog_name","ceil","ceiling","chain","change","char","char_length","character","character_length","character_set_catalog","character_set_name","character_set_schema","characteristics","characters","check","checked","checkpoint","checksum","class","class_origin","clob","close","cluster","clustered","coalesce","cobol","collate","collation","collation_catalog","collation_name","collation_schema","collect","column","column_name","columns","command_function","command_function_code","comment","commit","committed","completion","compress","compute","condition","condition_number","connect","connection","connection_name","constraint","constraint_catalog","constraint_name","constraint_schema","constraints","constructor","contains","containstable","continue","conversion","convert","copy","corr","corresponding","count","covar_pop","covar_samp","create","createdb","createrole","createuser","cross","csv","cube","cume_dist","current","current_date","current_default_transform_group","current_path","current_role","current_time","current_timestamp","current_transform_group_for_type","current_user","cursor","cursor_name","cycle","data","database","databases","date","datetime","datetime_interval_code","datetime_interval_precision","day","day_hour","day_microsecond","day_minute","day_second","dayofmonth","dayofweek","dayofyear","dbcc","deallocate","dec","decimal","declare","default","defaults","deferrable","deferred","defined","definer","degree","delay_key_write","delayed","delete","delimiter","delimiters","dense_rank","deny","depth","deref","derived","desc","describe","descriptor","destroy","destructor","deterministic","diagnostics","dictionary","disable","disconnect","disk","dispatch","distinct","distinctrow","distributed","div","do","domain","double","drop","dual","dummy","dump","dynamic","dynamic_function","dynamic_function_code","each","element","else","elseif","enable","enclosed","encoding","encrypted","end","end-exec","enum","equals","errlvl","escape","escaped","every","except","exception","exclude","excluding","exclusive","exec","execute","existing","exists","exit","exp","explain","external","extract","false","fetch","fields","file","fillfactor","filter","final","first","float","float4","float8","floor","flush","following","for","force","foreign","fortran","forward","found","free","freetext","freetexttable","freeze","from","full","fulltext","function","fusion","g","general","generated","get","global","go","goto","grant","granted","grants","greatest","group","grouping","handler","having","header","heap","hierarchy","high_priority","hold","holdlock","host","hosts","hour","hour_microsecond","hour_minute","hour_second","identified","identity","identity_insert","identitycol","if","ignore","ilike","immediate","immutable","implementation","implicit","in","include","including","increment","index","indicator","infile","infix","inherit","inherits","initial","initialize","initially","inner","inout","input","insensitive","insert","insert_id","instance","instantiable","instead","int","int1","int2","int3","int4","int8","integer","intersect","intersection","interval","into","invoker","is","isam","isnull","isolation","iterate","join","k","key","key_member","key_type","keys","kill","lancompiler","language","large","last","last_insert_id","lateral","leading","least","leave","left","length","less","level","like","limit","lineno","lines","listen","ln","load","local","localtime","localtimestamp","location","locator","lock","login","logs","long","longblob","longtext","loop","low_priority","lower","m","map","match","matched","max","max_rows","maxextents","maxvalue","mediumblob","mediumint","mediumtext","member","merge","message_length","message_octet_length","message_text","method","middleint","min","min_rows","minus","minute","minute_microsecond","minute_second","minvalue","mlslabel","mod","mode","modifies","modify","module","month","monthname","more","move","multiset","mumps","myisam","name","names","national","natural","nchar","nclob","nesting","new","next","no","no_write_to_binlog","noaudit","nocheck","nocompress","nocreatedb","nocreaterole","nocreateuser","noinherit","nologin","nonclustered","none","normalize","normalized","nosuperuser","not","nothing","notify","notnull","nowait","null","nullable","nullif","nulls","number","numeric","object","octet_length","octets","of","off","offline","offset","offsets","oids","old","on","online","only","open","opendatasource","openquery","openrowset","openxml","operation","operator","optimize","option","optionally","options","or","order","ordering","ordinality","others","out","outer","outfile","output","over","overlaps","overlay","overriding","owner","pack_keys","pad","parameter","parameter_mode","parameter_name","parameter_ordinal_position","parameter_specific_catalog","parameter_specific_name","parameter_specific_schema","parameters","partial","partition","pascal","password","path","pctfree","percent","percent_rank","percentile_cont","percentile_disc","placing","plan","pli","position","postfix","power","preceding","precision","prefix","preorder","prepare","prepared","preserve","primary","print","prior","privileges","proc","procedural","procedure","process","processlist","public","purge","quote","raid0","raiserror","range","rank","raw","read","reads","readtext","real","recheck","reconfigure","recursive","ref","references","referencing","regexp","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","reindex","relative","release","reload","rename","repeat","repeatable","replace","replication","require","reset","resignal","resource","restart","restore","restrict","result","return","returned_cardinality","returned_length","returned_octet_length","returned_sqlstate","returns","revoke","right","rlike","role","rollback","rollup","routine","routine_catalog","routine_name","routine_schema","row","row_count","row_number","rowcount","rowguidcol","rowid","rownum","rows","rule","save","savepoint","scale","schema","schema_name","schemas","scope","scope_catalog","scope_name","scope_schema","scroll","search","second","second_microsecond","section","security","select","self","sensitive","separator","sequence","serializable","server_name","session","session_user","set","setof","sets","setuser","share","show","shutdown","signal","similar","simple","size","smallint","some","soname","source","space","spatial","specific","specific_name","specifictype","sql","sql_big_result","sql_big_selects","sql_big_tables","sql_calc_found_rows","sql_log_off","sql_log_update","sql_low_priority_updates","sql_select_limit","sql_small_result","sql_warnings","sqlca","sqlcode","sqlerror","sqlexception","sqlstate","sqlwarning","sqrt","ssl","stable","start","starting","state","statement","static","statistics","status","stddev_pop","stddev_samp","stdin","stdout","storage","straight_join","strict","string","structure","style","subclass_origin","sublist","submultiset","substring","successful","sum","superuser","symmetric","synonym","sysdate","sysid","system","system_user","table","table_name","tables","tablesample","tablespace","temp","template","temporary","terminate","terminated","text","textsize","than","then","ties","time","timestamp","timezone_hour","timezone_minute","tinyblob","tinyint","tinytext","to","toast","top","top_level_count","trailing","tran","transaction","transaction_active","transactions_committed","transactions_rolled_back","transform","transforms","translate","translation","treat","trigger","trigger_catalog","trigger_name","trigger_schema","trim","true","truncate","trusted","tsequal","type","uescape","uid","unbounded","uncommitted","under","undo","unencrypted","union","unique","unknown","unlisten","unlock","unnamed","unnest","unsigned","until","update","updatetext","upper","usage","use","user","user_defined_type_catalog","user_defined_type_code","user_defined_type_name","user_defined_type_schema","using","utc_date","utc_time","utc_timestamp","vacuum","valid","validate","validator","value","values","var_pop","var_samp","varbinary","varchar","varchar2","varcharacter","variable","variables","varying","verbose","view","volatile","waitfor","when","whenever","where","while","width_bucket","window","with","within","without","work","write","writetext","x509","xor","year","year_month","zerofill","zone"));
for(String word: question.toString().split(" ")){
if(stopWords.contains(word))continue;
if(sqlWords.contains(word))continue;
//skip words like '345'
if(word.toUpperCase().equals(word.toLowerCase()))continue;
addQueryWord(word);
}
List<TripleSearchResult> triples;
try {
triples = BioASQUtil.searchLinkedLifeData(service, jcas, sb.toString(), pages, hits);
LOG.info("Retrieved {} triples.", triples.size());
} catch (IOException e) {
throw new AnalysisEngineProcessException(e);
}
triples.forEach(TripleSearchResult::addToIndexes);
}
开发者ID:oaqa,项目名称:bioasq,代码行数:37,代码来源:GoPubMedTripleRetrievalExecutor.java
示例10: extract
import org.apache.uima.fit.util.FSCollectionFactory; //导入依赖的package包/类
@Override
public List<Feature> extract(JCas view, Annotation focusAnnotation)
throws CleartkExtractorException {
Word focusWord = PUtils.getWordAnno(view, focusAnnotation);
if (focusWord == null || focusWord.getWordforms() == null) {
return ImmutableList.of();
}
Collection<Wordform> wfs = FSCollectionFactory.create(focusWord.getWordforms(),
Wordform.class);
Set<String> tags = Sets.newHashSet();
for (Wordform wf : wfs) {
tags.add(wf.getPos());
}
return Lists.newArrayList(Collections2.transform(tags, tag2Feature));
}
开发者ID:textocat,项目名称:textokit-core,代码行数:16,代码来源:PosTagFeatureExtractor.java
示例11: process
import org.apache.uima.fit.util.FSCollectionFactory; //导入依赖的package包/类
@Override
public void process(JCas jCas) throws AnalysisEngineProcessException {
for (Word word : JCasUtil.select(jCas, Word.class)) {
FSArray wfs = word.getWordforms();
if (wfs == null) {
continue;
}
for (Wordform wf : FSCollectionFactory.create(wfs, Wordform.class)) {
String tag = tagMapper.toTag(FSUtils.toSet(wf.getGrammems()));
wf.setPos(tag);
}
}
}
开发者ID:textocat,项目名称:textokit-core,代码行数:14,代码来源:TagAssembler.java
示例12: process
import org.apache.uima.fit.util.FSCollectionFactory; //导入依赖的package包/类
@Override
public void process(JCas jcas) throws AnalysisEngineProcessException {
for (Word word : JCasUtil.select(jcas, Word.class)) {
FSArray wordformsFSArray = word.getWordforms();
if (wordformsFSArray == null) {
continue;
}
Collection<Wordform> wordforms = FSCollectionFactory.create(wordformsFSArray,
Wordform.class);
for (Wordform wf : wordforms) {
trimmer.trim(jcas, wf);
}
}
}
开发者ID:textocat,项目名称:textokit-core,代码行数:15,代码来源:PosTrimmingAnnotator.java
示例13: getCollection
import org.apache.uima.fit.util.FSCollectionFactory; //导入依赖的package包/类
@Override
@SuppressWarnings("unchecked")
protected Collection<E> getCollection(FeatureStructure anno) {
ArrayFS fsArray = (ArrayFS) anno.getFeatureValue(feature);
if (fsArray == null) {
return null;
}
return (Collection<E>) FSCollectionFactory.create(fsArray);
}
开发者ID:textocat,项目名称:textokit-core,代码行数:10,代码来源:FSCollectionFeatureMatcher.java
示例14: toList
import org.apache.uima.fit.util.FSCollectionFactory; //导入依赖的package包/类
public static List<FeatureStructure> toList(Feature targetFeat, FeatureStructure fs) {
if (fs == null) {
return null;
}
// TODO handle lists
if (targetFeat.getRange().isArray()) {
return new ArrayList<FeatureStructure>(
FSCollectionFactory.create((ArrayFS) fs));
} else {
throw new UnsupportedOperationException();
}
}
开发者ID:textocat,项目名称:textokit-core,代码行数:13,代码来源:PUtils.java
示例15: addPhraseWordsAndHead
import org.apache.uima.fit.util.FSCollectionFactory; //导入依赖的package包/类
/**
* Add constituent words and the head word to a PhraseChunk
*/
private PhraseChunk addPhraseWordsAndHead(PhraseChunk chunk, TextBlock block) {
List<WordToken> constituentWords = new ArrayList<WordToken>();
for (WordToken word : JCasUtil.selectCovered(block.getJCas(), WordToken.class, chunk)) {
constituentWords.add(word);
}
chunk.setConstituentWords(FSCollectionFactory.createFSArray(block.getJCas(), constituentWords));
int headWordId = constituentWords.size() - 1;
// Run through prior words, check for propositional - if so skip, if not break
for (int a = constituentWords.size() - 2; a > 1; a--) {
WordToken wtA = constituentWords.get(a);
// If a POS tag or word value is prepositional, end increment head word index
if ("IN".equals(wtA.getPartOfSpeech()) || ",".equals(wtA.getPartOfSpeech())
|| prepositions.contains(wtA.getCoveredText())) {
headWordId = a - 1;
} else {
headWordId = a;
break;
}
}
chunk.setHeadWord(constituentWords.get(headWordId));
return chunk;
}
开发者ID:dstl,项目名称:baleen,代码行数:31,代码来源:OpenNLP.java
示例16: makeLinkHostFS
import org.apache.uima.fit.util.FSCollectionFactory; //导入依赖的package包/类
private static AnnotationFS makeLinkHostFS(JCas aJCas, String aType, int aBegin, int aEnd,
FeatureStructure... aLinks)
{
Type hostType = aJCas.getTypeSystem().getType(aType);
AnnotationFS hostA1 = aJCas.getCas().createAnnotation(hostType, aBegin, aEnd);
hostA1.setFeatureValue(hostType.getFeatureByBaseName("links"),
FSCollectionFactory.createFSArray(aJCas, asList(aLinks)));
aJCas.getCas().addFsToIndexes(hostA1);
return hostA1;
}
开发者ID:webanno,项目名称:webanno,代码行数:11,代码来源:WebAnnoTsv3WriterTestBase.java
示例17: makeLinkHostFS
import org.apache.uima.fit.util.FSCollectionFactory; //导入依赖的package包/类
public static void makeLinkHostFS(JCas aJCas, int aBegin, int aEnd, FeatureStructure... aLinks)
{
Type hostType = aJCas.getTypeSystem().getType(HOST_TYPE);
AnnotationFS hostA1 = aJCas.getCas().createAnnotation(hostType, aBegin, aEnd);
hostA1.setFeatureValue(hostType.getFeatureByBaseName("links"),
FSCollectionFactory.createFSArray(aJCas, asList(aLinks)));
aJCas.getCas().addFsToIndexes(hostA1);
}
开发者ID:webanno,项目名称:webanno,代码行数:9,代码来源:DiffUtils.java
示例18: makeLinkHostMultiSPanFeatureFS
import org.apache.uima.fit.util.FSCollectionFactory; //导入依赖的package包/类
public static AnnotationFS makeLinkHostMultiSPanFeatureFS(JCas aJCas, int aBegin, int aEnd,
Feature aSpanFeature, String aValue, FeatureStructure... aLinks)
{
Type hostType = aJCas.getTypeSystem().getType(HOST_TYPE);
AnnotationFS hostA1 = aJCas.getCas().createAnnotation(hostType, aBegin, aEnd);
hostA1.setFeatureValue(hostType.getFeatureByBaseName("links"),
FSCollectionFactory.createFSArray(aJCas, asList(aLinks)));
hostA1.setStringValue(aSpanFeature, aValue);
aJCas.getCas().addFsToIndexes(hostA1);
return hostA1;
}
开发者ID:webanno,项目名称:webanno,代码行数:12,代码来源:DiffUtils.java
示例19: setHeadRelations
import org.apache.uima.fit.util.FSCollectionFactory; //导入依赖的package包/类
@Override
public void setHeadRelations(
JCas jCas,
DependencyNode node,
List<DependencyRelation> headRelations) {
node.setHeadRelations(new FSArray(jCas, headRelations.size()));
FSCollectionFactory.fillArrayFS(node.getHeadRelations(), headRelations);
}
开发者ID:ClearTK,项目名称:cleartk,代码行数:9,代码来源:CleartkDependencyOps.java
示例20: setChildRelations
import org.apache.uima.fit.util.FSCollectionFactory; //导入依赖的package包/类
@Override
public void setChildRelations(
JCas jCas,
DependencyNode node,
List<DependencyRelation> childRelations) {
node.setChildRelations(new FSArray(jCas, childRelations.size()));
FSCollectionFactory.fillArrayFS(node.getChildRelations(), childRelations);
}
开发者ID:ClearTK,项目名称:cleartk,代码行数:9,代码来源:CleartkDependencyOps.java
注:本文中的org.apache.uima.fit.util.FSCollectionFactory类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论