Package edu.ucla.sspace.dependency

Examples of edu.ucla.sspace.dependency.DependencyPath.last()


                Iterator<DependencyPath> pathIter =
                    new FilteredDependencyIterator(nodes[i], acceptor, 1);

                while (pathIter.hasNext()) {
                    DependencyPath path = pathIter.next();
                    DependencyTreeNode last = path.last();

                    // Reject words that are not nouns, verbs, or adjectives.
                    if (!(last.pos().startsWith("N") ||
                          last.pos().startsWith("J") ||
                          last.pos().startsWith("V")))
View Full Code Here


                // 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

        Iterator<DependencyPath> paths = new FilteredDependencyIterator(
                focusNode, acceptor, pathLength);

        while (paths.hasNext()) {
            DependencyPath path = paths.next();
            if (readOnly && !indexMap.containsKey(path.last().word()))
                continue;

            TernaryVector termVector = indexMap.get(path.last().word());
            if (permFunc != null)
                termVector = permFunc.permute(termVector, path);
View Full Code Here

        while (paths.hasNext()) {
            DependencyPath path = paths.next();
            if (readOnly && !indexMap.containsKey(path.last().word()))
                continue;

            TernaryVector termVector = indexMap.get(path.last().word());
            if (permFunc != null)
                termVector = permFunc.permute(termVector, path);
            add(meaning, termVector);
        }
        return meaning;
View Full Code Here

                    // the co-occurrences of the focus word in the dimension
                    // that the BasisFunction states.
                    while (paths.hasNext()) {
                        DependencyPath path = paths.next();

                        String occurrence = path.last().word();
                        int featureIndex = basis.getDimension(occurrence);

                        double score = weighter.scorePath(path);
                        matrixEntryToCount.put(new Pair<Integer>(
                                    focusIndex, featureIndex), score);
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.