Examples of DependencyIterator


Examples of edu.ucla.sspace.dependency.DependencyIterator

                IntegerVector focusMeaning = getSemanticVector(focusWord);

                // Create the path iterator for all acceptable paths rooted at
                // the focus word in the sentence.
                Iterator<DependencyPath> pathIter =
                    new DependencyIterator(nodes[i], acceptor, pathLength);

                // For every path, obtain the index vector of the last word in
                // the path and add it to the semantic vector for the focus
                // word.  The index vector is permuted if a permutation
                // function has been provided based on the contents of the path.
                while (pathIter.hasNext()) {
                    DependencyPath path = pathIter.next();
                    TernaryVector termVector = indexMap.get(path.last().word());
                    if (permFunc != null)
                        termVector = permFunc.permute(termVector, path);
                    add(focusMeaning, termVector);
                }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.