@Override protected void tallyRoot(Tree lt, double weight) { // this list is in full (not reduced) tag space List<IntDependency> deps = MLEDependencyGrammar.treeToDependencyList(lt, wordIndex, tagIndex); for (IntDependency dependency : deps) { dependencyCounter.incrementCount(dependency, weight); } }
@Override public DependencyGrammar formResult() { wordIndex.indexOf(Lexicon.UNKNOWN_WORD, true); MLEDependencyGrammar dg = new MLEDependencyGrammar( tlpParams, directional, useDistance, useCoarseDistance, basicCategoryTagsInDependencyGrammar, op, wordIndex, tagIndex); for (IntDependency dependency : dependencyCounter.keySet()) { dg.addRule(dependency, dependencyCounter.getCount(dependency)); } return dg; }