leila.patterns
Class Linkage

java.lang.Object
  extended by leila.patterns.Linkage
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
LinearLinkage

public class Linkage
extends java.lang.Object
implements java.io.Serializable

This class is part of LEILA (http://mpii.de/yago-naga/leila). It is licensed under the Creative Commons Attribution License (http://creativecommons.org/licenses/by/3.0) by the author Fabian M. Suchanek (http://suchanek.name).

Linkage.java represents a sentence with its links. A linkage is constructed from an LGO-file (Link Grammar Output).

See Also:
Serialized Form

Field Summary
protected  java.util.List<LinkageWord> EMPTYLINKAGEWORDS
          Empty sentence list
 int id
          Identifies the sequence of words
 java.util.List<LinkageWord> linkageWords
          words of the sentence in sentence order
protected static int oldSentence
          Contains last sentence to determine whether to call newDocument
 
Constructor Summary
protected Linkage()
          For subclasses
  Linkage(java.util.List<java.lang.String> lines, Document doc)
          Constructs a linkage from a list of lines like
 
Method Summary
protected  java.util.List<Link> find(LinkageWord w, LinkageWord w2, Link.Direction d)
          Performs a depth-first search to find a bridge from one basis word to another
 int hashCode()
          Returns a hashCode (Positive for normal Linkages)
protected  LinkagePattern linkagePattern(LinkageWord w, LinkageWord w2, Link.Direction d)
          Returns a LinkagePattern for a pair of basis words, seeks only in one direction
 java.util.List<LinkagePattern> linkagePatterns(Relation r)
          Returns a list of LinkagePatterns for all pairs of interesting words judged as EXAMPLEs by the relation
 java.lang.String toString()
          Returns a String representation (for debugging)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

oldSentence

protected static int oldSentence
Contains last sentence to determine whether to call newDocument


linkageWords

public java.util.List<LinkageWord> linkageWords
words of the sentence in sentence order


EMPTYLINKAGEWORDS

protected java.util.List<LinkageWord> EMPTYLINKAGEWORDS
Empty sentence list


id

public int id
Identifies the sequence of words

Constructor Detail

Linkage

public Linkage(java.util.List<java.lang.String> lines,
               Document doc)
Constructs a linkage from a list of lines like
        +---------------------Xp---------------------+
        |           +-------Ss------+                |
        +-----Wd----+----Bs---+     |                |
        |      +-Ds-+-Rn-+Sp*i+     +---Pv--+--Os-+  |
        |      |    |    |    |     |       |     |  |
    LEFT-WALL the man.n I.p saw.v was.v called.v Bob .


Linkage

protected Linkage()
For subclasses

Method Detail

linkagePatterns

public java.util.List<LinkagePattern> linkagePatterns(Relation r)
Returns a list of LinkagePatterns for all pairs of interesting words judged as EXAMPLEs by the relation


linkagePattern

protected LinkagePattern linkagePattern(LinkageWord w,
                                        LinkageWord w2,
                                        Link.Direction d)
Returns a LinkagePattern for a pair of basis words, seeks only in one direction


find

protected java.util.List<Link> find(LinkageWord w,
                                    LinkageWord w2,
                                    Link.Direction d)
Performs a depth-first search to find a bridge from one basis word to another


toString

public java.lang.String toString()
Returns a String representation (for debugging)

Overrides:
toString in class java.lang.Object

hashCode

public int hashCode()
Returns a hashCode (Positive for normal Linkages)

Overrides:
hashCode in class java.lang.Object