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


Java DependencyParse.setUuid方法代码示例

本文整理汇总了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;
}
 
开发者ID:mgormley,项目名称:pacaya-nlp,代码行数:24,代码来源:ConcreteWriter.java

示例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;
}
 
开发者ID:mgormley,项目名称:pacaya-nlp,代码行数:24,代码来源:ConcreteWriter.java

示例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);
}
 
开发者ID:mgormley,项目名称:pacaya-nlp,代码行数:17,代码来源:ConcreteReaderTest.java

示例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;
}
 
开发者ID:hltcoe,项目名称:concrete-stanford-deprecated2,代码行数:12,代码来源:PreNERCoreMapWrapper.java


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