List<TypedDependency> extraDeps = new ArrayList<>(); for (TypedDependency td : dependencies) { if (td.extra()) { extraDeps.add(td); } else {
String depTag = td.dep().tag(); int depIdx = td.dep().index(); boolean extra = td.extra();
List<TypedDependency> extraDeps = new ArrayList<>(); for (TypedDependency dep : deps) { if (dep.extra()) { extraDeps.add(dep); } else {
/** * This is the constructor used by the parser. */ public SemanticGraph(Collection<TypedDependency> dependencies) { graph = new DirectedMultiGraph<>(outerMapFactory, innerMapFactory); roots = wordMapFactory.newSet(); for (TypedDependency d : dependencies) { IndexedWord gov = d.gov(); IndexedWord dep = d.dep(); GrammaticalRelation reln = d.reln(); if (reln != ROOT) { // the root relation only points to the root: the governor is a fake node that we don't want to add in the graph // It is unnecessary to call addVertex, since addEdge will // implicitly add vertices if needed //addVertex(gov); //addVertex(dep); addEdge(gov, dep, reln, Double.NEGATIVE_INFINITY, d.extra()); } else { //it's the root and we add it addVertex(dep); roots.add(dep); } } // there used to be an if clause that filtered out the case of empty // dependencies. However, I could not understand (or replicate) the error // it alluded to, and it led to empty dependency graphs for very short // fragments, // which meant they were ignored by the RTE system. Changed. (pado) // See also SemanticGraphFactory.makeGraphFromTree(). }
List<TypedDependency> extraDeps = new ArrayList<TypedDependency>(); for (TypedDependency td : dependencies) { if (td.extra()) { extraDeps.add(td); } else {
List<TypedDependency> extraDeps = new ArrayList<>(); for (TypedDependency td : dependencies) { if (td.extra()) { extraDeps.add(td); } else {
List<TypedDependency> extraDeps = new ArrayList<>(); for (TypedDependency td : dependencies) { if (td.extra()) { extraDeps.add(td); } else {
List<TypedDependency> extraDeps = new ArrayList<TypedDependency>(); for (TypedDependency td : dependencies) { if (td.extra()) { extraDeps.add(td);
String dep = td.dep().value(); int depIdx = td.dep().index(); boolean extra = td.extra();
List<TypedDependency> extraDeps = new ArrayList<TypedDependency>(); for (TypedDependency dep : deps) { if (dep.extra()) { extraDeps.add(dep); } else {
String depTag = td.dep().tag(); int depIdx = td.dep().index(); boolean extra = td.extra();
List<TypedDependency> extraDeps = new ArrayList<TypedDependency>(); for (TypedDependency dep : deps) { if (dep.extra()) { extraDeps.add(dep); } else {
String depTag = td.dep().tag(); int depIdx = td.dep().index(); boolean extra = td.extra();
String depTag = td.dep().label().tag(); int depIdx = td.dep().index(); boolean extra = td.extra();
List<TypedDependency> extraDeps = new ArrayList<>(); for (TypedDependency dep : deps) { if (dep.extra()) { extraDeps.add(dep); } else {
List<TypedDependency> extraDeps = new ArrayList<>(); for (TypedDependency dep : deps) { if (dep.extra()) { extraDeps.add(dep); } else {
/** * This is the constructor used by the parser. */ public SemanticGraph(Collection<TypedDependency> dependencies) { graph = new DirectedMultiGraph<>(outerMapFactory, innerMapFactory); roots = wordMapFactory.newSet(); for (TypedDependency d : dependencies) { IndexedWord gov = d.gov(); IndexedWord dep = d.dep(); GrammaticalRelation reln = d.reln(); if (reln != ROOT) { // the root relation only points to the root: the governor is a fake node that we don't want to add in the graph // It is unnecessary to call addVertex, since addEdge will // implicitly add vertices if needed //addVertex(gov); //addVertex(dep); addEdge(gov, dep, reln, Double.NEGATIVE_INFINITY, d.extra()); } else { //it's the root and we add it addVertex(dep); roots.add(dep); } } // there used to be an if clause that filtered out the case of empty // dependencies. However, I could not understand (or replicate) the error // it alluded to, and it led to empty dependency graphs for very short // fragments, // which meant they were ignored by the RTE system. Changed. (pado) // See also SemanticGraphFactory.makeGraphFromTree(). }
/** * This is the constructor used by the parser. */ public SemanticGraph(Collection<TypedDependency> dependencies) { graph = new DirectedMultiGraph<>(outerMapFactory, innerMapFactory); roots = wordMapFactory.newSet(); for (TypedDependency d : dependencies) { IndexedWord gov = d.gov(); IndexedWord dep = d.dep(); GrammaticalRelation reln = d.reln(); if (reln != ROOT) { // the root relation only points to the root: the governor is a fake node that we don't want to add in the graph // It is unnecessary to call addVertex, since addEdge will // implicitly add vertices if needed //addVertex(gov); //addVertex(dep); addEdge(gov, dep, reln, Double.NEGATIVE_INFINITY, d.extra()); } else { //it's the root and we add it addVertex(dep); roots.add(dep); } } // there used to be an if clause that filtered out the case of empty // dependencies. However, I could not understand (or replicate) the error // it alluded to, and it led to empty dependency graphs for very short // fragments, // which meant they were ignored by the RTE system. Changed. (pado) // See also SemanticGraphFactory.makeGraphFromTree(). }
addEdge(govVertex, depVertex, reln, Double.NEGATIVE_INFINITY, d.extra()); } else { //it's the root and we add it IndexedWord depVertex = new IndexedWord(docID, sentIndex, dep.index(), dep.label());
currTypedDep.extra() ? DependencyFlavor.ENHANCED : DependencyFlavor.BASIC);