本文整理汇总了Java中edu.jhu.hlt.concrete.DependencyParse.setUuid方法的典型用法代码示例。如果您正苦于以下问题:Java DependencyParse.setUuid方法的具体用法?Java DependencyParse.setUuid怎么用?Java DependencyParse.setUuid使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类edu.jhu.hlt.concrete.DependencyParse
的用法示例。
在下文中一共展示了DependencyParse.setUuid方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: makeDepParse
import edu.jhu.hlt.concrete.DependencyParse; //导入方法依赖的package包/类
private DependencyParse makeDepParse(int[] parents, List<String> depRels) {
if(depRels != null && parents.length != depRels.size()) {
throw new IllegalArgumentException("Parents length doesn't match depRels length");
}
DependencyParse p = new DependencyParse();
p.setUuid(getUUID());
AnnotationMetadata meta = new AnnotationMetadata();
meta.setTool(DEP_PARSE_TOOL);
meta.setTimestamp(timestamp);
p.setMetadata(meta);
p.setDependencyList(new ArrayList<Dependency>());
for(int i=0; i<parents.length; i++) {
if (parents[i] == -2) { continue; }
Dependency d = new Dependency();
d.setDep(i);
d.setGov(parents[i]);
if (depRels != null && depRels.get(i) != null) {
d.setEdgeType(depRels.get(i));
}
p.addToDependencyList(d);
}
return p;
}
示例2: makeDependencyParse
import edu.jhu.hlt.concrete.DependencyParse; //导入方法依赖的package包/类
private DependencyParse makeDependencyParse(SrlGraph srl, AnnoSentence from, AnnotationMetadata meta) {
DependencyParse p = new DependencyParse();
p.setUuid(getUUID());
p.setMetadata(meta);
p.setDependencyList(new ArrayList<Dependency>());
for(SrlPred pred : srl.getPreds()) {
{
Dependency d = new Dependency();
d.setGov(-1);
d.setDep(pred.getPosition());
d.setEdgeType(pred.getLabel());
p.addToDependencyList(d);
}
for(SrlEdge e : pred.getEdges()) {
Dependency ed = new Dependency();
ed.setGov(pred.getPosition());
ed.setDep(e.getArg().getPosition());
ed.setEdgeType(e.getLabel());
p.addToDependencyList(ed);
}
}
return p;
}
示例3: addDepParse
import edu.jhu.hlt.concrete.DependencyParse; //导入方法依赖的package包/类
private static void addDepParse(Tokenization tokenization, String toolName, int[] parents) {
List<Dependency> depList = new ArrayList<>();
int dep = 0;
for (int gov : parents) {
Dependency d = new Dependency();
d.setEdgeType("l"+dep);
d.setGov(gov);
d.setDep(dep++);
depList.add(d);
}
DependencyParse dp = new DependencyParse();
dp.setUuid(getUUID());
dp.setDependencyList(depList);
dp.setMetadata(getMetadata(toolName));
tokenization.addToDependencyParseList(dp);
}
示例4: makeDepParse
import edu.jhu.hlt.concrete.DependencyParse; //导入方法依赖的package包/类
private DependencyParse makeDepParse(SemanticGraph semGraph, UUID tokenizationUUID, String toolName) {
DependencyParse depParse = new DependencyParse();
depParse.setUuid(this.gen.next());
TheoryDependencies td = new TheoryDependencies();
td.addToTokenizationTheoryList(tokenizationUUID);
AnnotationMetadata md = new AnnotationMetadata(toolName, Timing.currentLocalTime(), 1);
depParse.setMetadata(md);
List<Dependency> dependencies = makeDependencies(semGraph);
depParse.setDependencyList(dependencies);
return depParse;
}