Package edu.ucla.sspace.dependency

Examples of edu.ucla.sspace.dependency.DependencyRelation


                    // Create a RelationTuple as a local key that records this
                    // relation tuple occurrence.  If there is not a local
                    // relation vector, create it.  Then add an occurrence count
                    // of 1.
                    DependencyRelation relation = path.iterator().next();

                    // Skip relations that do not have the focusWord as the
                    // head word in the relation.  The inverse relation will
                    // eventually be encountered and we'll account for it then.
                    if (!relation.headNode().word().equals(focusWord))
                        continue;

                    RelationTuple relationKey = new RelationTuple(
                            focusIndex, relation.relation().intern());
                    SparseDoubleVector relationVector = localTuples.get(
                            relationKey);
                    if (relationVector == null) {
                        relationVector = new CompactSparseVector();
                        localTuples.put(relationKey, relationVector);
View Full Code Here


        // meaning.
        return VectorMath.multiplyUnmodified(focusMeaning, secondMeaning);
    }

    private SparseDoubleVector contextualize(DependencyPath path) {
        DependencyRelation rel = path.iterator().next();
        String relation = rel.relation();
        String focusTerm = path.first().word();
        String otherTerm = path.last().word();

        // Skip any filtered features.
        if (otherTerm.equals(EMPTY_STRING))
            return null;
        boolean isFocusHead = !rel.headNode().word().equals(focusTerm);
        return svs.contextualize(focusTerm, relation, otherTerm, isFocusHead);
    }
View Full Code Here

TOP

Related Classes of edu.ucla.sspace.dependency.DependencyRelation

Copyright © 2018 www.massapicom. 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.