leila.patterns
Class LinkageWord

java.lang.Object
  extended by leila.patterns.LinkageWord
All Implemented Interfaces:
java.io.Serializable

public final class LinkageWord
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).

LinkageWord.java represents a word in a Linkage.

See Also:
Serialized Form

Nested Class Summary
static class LinkageWord.Type
          Type of LinkageWords
 
Field Summary
 java.util.List<Link> contexts
          Links to other words
static java.util.EnumSet<LinkageWord.Type> DUMMIES
          Types that become dummies when essentialized
static java.util.EnumSet<LinkageWord.Type> INTERESTING
          Type for interesting words (NOUN|NUMBER|DATE)
static int MAXBITS
          Maximal number of bits generated by toArray
static int MAXINT
           
static  pronouns
          Contains the references that will be resolved
 int stopWordNum
          Stores the stopword-number, if type==STOPWORD
static  stopWords
          Contains stopwords
 java.util.EnumSet<LinkageWord.Type> type
          Stores the type of this word
 java.lang.String word
          Name of the word
 
Constructor Summary
LinkageWord(java.lang.String w)
          Constructs a LinkageWord from a string like "man.n"
 
Method Summary
 void addLink(Link l)
          Adds a link
 void adoptWord(LinkageWord w)
          Adopts the argument's word
 boolean equals(java.lang.Object o)
          Two LinkageWords are equal if their words are equal Treats numbers and dates appropriately
 LinkageWord essentialize()
          Returns an essentialized copy of the given LinkageWord The new LinkageWord has no contexts, dummies are simplified
 int hashCode()
          Returns a hashCode
 boolean is(java.util.EnumSet<LinkageWord.Type> n)
          Returns TRUE if this type set contains one of the given types
 boolean is(LinkageWord.Type n)
          Returns TRUE if this type set contains the given type
 void set(java.lang.String w)
          Sets the word (and types) of this LinkageWord
 double similarity(LinkageWord w)
          Returns a similarity measure
 int toArray(int[] array, int pos, int offset)
          Stores an integer representation of this word in an array, starting at pos, adding offset and returning the new pos.
 java.lang.String toString()
          Returns a String representation (for debugging)
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

INTERESTING

public static final java.util.EnumSet<LinkageWord.Type> INTERESTING
Type for interesting words (NOUN|NUMBER|DATE)


DUMMIES

public static final java.util.EnumSet<LinkageWord.Type> DUMMIES
Types that become dummies when essentialized


word

public java.lang.String word
Name of the word


contexts

public java.util.List<Link> contexts
Links to other words


type

public java.util.EnumSet<LinkageWord.Type> type
Stores the type of this word


stopWordNum

public int stopWordNum
Stores the stopword-number, if type==STOPWORD


MAXBITS

public static final int MAXBITS
Maximal number of bits generated by toArray

See Also:
Constant Field Values

pronouns

public static  pronouns
Contains the references that will be resolved


stopWords

public static  stopWords
Contains stopwords


MAXINT

public static final int MAXINT
Constructor Detail

LinkageWord

public LinkageWord(java.lang.String w)
Constructs a LinkageWord from a string like "man.n"

Method Detail

hashCode

public int hashCode()
Returns a hashCode

Overrides:
hashCode in class java.lang.Object

set

public void set(java.lang.String w)
Sets the word (and types) of this LinkageWord


addLink

public void addLink(Link l)
Adds a link


toString

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

Overrides:
toString in class java.lang.Object

is

public boolean is(LinkageWord.Type n)
Returns TRUE if this type set contains the given type


is

public boolean is(java.util.EnumSet<LinkageWord.Type> n)
Returns TRUE if this type set contains one of the given types


equals

public boolean equals(java.lang.Object o)
Two LinkageWords are equal if their words are equal Treats numbers and dates appropriately

Overrides:
equals in class java.lang.Object

similarity

public double similarity(LinkageWord w)
Returns a similarity measure


essentialize

public LinkageWord essentialize()
Returns an essentialized copy of the given LinkageWord The new LinkageWord has no contexts, dummies are simplified


toArray

public int toArray(int[] array,
                   int pos,
                   int offset)
Stores an integer representation of this word in an array, starting at pos, adding offset and returning the new pos.


adoptWord

public void adoptWord(LinkageWord w)
Adopts the argument's word