leila.relations
Class InstanceOf

java.lang.Object
  extended by leila.relations.Relation
      extended by leila.relations.InstanceOf

public class InstanceOf
extends Relation

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).

InstanceOf.java implements the isa-Relation from WordNet. The class requires the files wn_s.pl and wn_hyp.pl. These files can be downloaded from the WordNet site. They are part of the Prolog version of WordNet. A copy of the files is also provided in the distribution package of LEILA. The following parameters are required in leila.ini:

By default, the copies that ship with LEILA are read.


Nested Class Summary
 
Nested classes/interfaces inherited from class leila.relations.Relation
Relation.WordPairType
 
Field Summary
protected  WordNet wn
          Holds the wordnet data
 
Constructor Summary
InstanceOf()
          Constructor
 
Method Summary
 Relation.WordPairType assess(LinkageWord w1, LinkageWord w2)
          Judges a pair of words
 int hops(java.lang.String s1, java.lang.String s2)
          Returs the minimal number of hops necessary from one concept to another
protected  int hops(WordNet.Synset s1, WordNet.Synset s2)
          Helper routine for hops
static void main(java.lang.String[] argv)
          Test routine
 boolean possibleExample(LinkageWord w)
          Tells whether this word is a possible example
 boolean requiresCounterexamples()
          returns true
protected  int seek(WordNet.Synset start, WordNet.Synset current, java.util.List<WordNet.Synset> goals, boolean foundAtomic)
          Seeks a goalWordNet.Synset upwards from startWordNet.Synset.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

wn

protected WordNet wn
Holds the wordnet data

Constructor Detail

InstanceOf

public InstanceOf()
           throws java.lang.Exception
Constructor

Throws:
java.lang.Exception
Method Detail

requiresCounterexamples

public boolean requiresCounterexamples()
returns true

Overrides:
requiresCounterexamples in class Relation

seek

protected int seek(WordNet.Synset start,
                   WordNet.Synset current,
                   java.util.List<WordNet.Synset> goals,
                   boolean foundAtomic)
Seeks a goalWordNet.Synset upwards from startWordNet.Synset. Returns 0 if not found, 1 if found, but above basic level, 2 if found below or equal to basic level, foundAtomic = there was an atomic term below currentWordNet.Synset. Initial call: foundAtomic==false, start==current


possibleExample

public boolean possibleExample(LinkageWord w)
Tells whether this word is a possible example

Overrides:
possibleExample in class Relation

assess

public Relation.WordPairType assess(LinkageWord w1,
                                    LinkageWord w2)
Judges a pair of words

Overrides:
assess in class Relation

toString

public java.lang.String toString()
Overrides:
toString in class Relation

hops

public int hops(java.lang.String s1,
                java.lang.String s2)
Returs the minimal number of hops necessary from one concept to another


hops

protected int hops(WordNet.Synset s1,
                   WordNet.Synset s2)
Helper routine for hops


main

public static void main(java.lang.String[] argv)
                 throws java.lang.Exception
Test routine

Throws:
java.lang.Exception