leila.relations
Class Birthdays

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

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

Birthdays.java implements the relation of persons with their birthdays. It requires a list of birthdates in the format

1985-11-31  Fabian M. Suchanek
...
The date may be given in any format accepted by the DateParser. This class requires the following parameter in leila.ini:


Nested Class Summary
 
Nested classes/interfaces inherited from class leila.relations.Relation
Relation.WordPairType
 
Field Summary
 java.util.Map<java.lang.String,java.util.List<java.lang.String>> birthdays
          Holds the map of birthdays
 
Constructor Summary
Birthdays()
          Reads the birthdays from the file given by the parameter "birthdaysFile" in leila.ini
Birthdays(java.lang.String f)
          Reads the birthdays from a given file
 
Method Summary
 Relation.WordPairType assess(LinkageWord w1, LinkageWord w2)
          Judges a pair of words
protected  void initializeFrom(java.lang.String f)
          Reads the birthdates from the given file.
static void main(java.lang.String[] argv)
          Test routine
 boolean possibleExample(LinkageWord w)
          tells whether a person is known in this relation
 boolean requiresCounterexamples()
          returns true
 
Methods inherited from class leila.relations.Relation
toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

birthdays

public java.util.Map<java.lang.String,java.util.List<java.lang.String>> birthdays
Holds the map of birthdays

Constructor Detail

Birthdays

public Birthdays(java.lang.String f)
          throws java.lang.Exception
Reads the birthdays from a given file

Throws:
java.lang.Exception

Birthdays

public Birthdays()
          throws java.lang.Exception
Reads the birthdays from the file given by the parameter "birthdaysFile" in leila.ini

Throws:
java.lang.Exception
Method Detail

requiresCounterexamples

public boolean requiresCounterexamples()
returns true

Overrides:
requiresCounterexamples in class Relation

initializeFrom

protected void initializeFrom(java.lang.String f)
                       throws java.lang.Exception
Reads the birthdates from the given file.

Throws:
java.lang.Exception

assess

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

Overrides:
assess in class Relation

possibleExample

public boolean possibleExample(LinkageWord w)
tells whether a person is known in this relation

Overrides:
possibleExample in class Relation

main

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

Throws:
java.lang.Exception