leila.parsing
Class Document

java.lang.Object
  extended by leila.parsing.Document

public class Document
extends java.lang.Object

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

Document.java maintains the contextual information of a sentence, like pronoun references and full names of people.


Nested Class Summary
protected  class Document.AgedLinkageWord
          Represents a reference target, memorizes the time it has been created
 
Field Summary
protected static  companies
          Contains words that refer to companies
protected  int current
          Counts the sentences
protected  java.util.Map<java.lang.String,LinkageWord> names
          Contains the mapping familiyname/companyname->fullname
protected  java.util.Map<java.lang.String,Document.AgedLinkageWord> references
          Maps references to their targets
protected static int SPAN
          Number of sentences during which a pronoun reference remains valid.
 
Constructor Summary
Document()
           
 
Method Summary
 void addName(LinkageWord l)
          Adds a completion mapping familyName/companyName -> fullName
 void addTarget(LinkageWord l)
          Adds a LinkageWord to the corresponding pronoun(s)
 void completeName(LinkageWord w)
          Completes a family name/company name by the full name if the name is known.
static boolean isResolvableReference(LinkageWord w)
          Tells whether the LinkageWord is a resolvable reference
 void newSentence()
          Notification for beginning of a new sentence
 void refreshTargetFor(java.lang.String s)
          Refreshes a target
 void resolveReference(LinkageWord w)
          Resolves a reference to its target
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SPAN

protected static final int SPAN
Number of sentences during which a pronoun reference remains valid. A value of 2 means: current and following sentence

See Also:
Constant Field Values

companies

protected static final  companies
Contains words that refer to companies


current

protected int current
Counts the sentences


names

protected java.util.Map<java.lang.String,LinkageWord> names
Contains the mapping familiyname/companyname->fullname


references

protected java.util.Map<java.lang.String,Document.AgedLinkageWord> references
Maps references to their targets

Constructor Detail

Document

public Document()
Method Detail

newSentence

public void newSentence()
Notification for beginning of a new sentence


isResolvableReference

public static boolean isResolvableReference(LinkageWord w)
Tells whether the LinkageWord is a resolvable reference


resolveReference

public void resolveReference(LinkageWord w)
Resolves a reference to its target


addTarget

public void addTarget(LinkageWord l)
Adds a LinkageWord to the corresponding pronoun(s)


refreshTargetFor

public void refreshTargetFor(java.lang.String s)
Refreshes a target


addName

public void addName(LinkageWord l)
Adds a completion mapping familyName/companyName -> fullName


completeName

public void completeName(LinkageWord w)
Completes a family name/company name by the full name if the name is known.