Class Text

java.lang.Object
edu.fiu.jtlex.data.Text
All Implemented Interfaces:
IText

public class Text extends Object implements IText
Default implementation of IText.
Author:
arada002
  • Constructor Details

    • Text

      public Text(String rawText, String text, Set<ITimex> timexes, Set<ILink> links, Set<IInstance> instances)
      Creates a new Text object.
      Parameters:
      rawText - Full article text including the tags. May not be null
      text - Article text without the tags. May not be null.
      timexes - Set of timex objects. May not be empty.
      links - Set of link objects. May not be empty.
      instances - Set of makeInstance objects. May not be empty.
      Throws:
      NullPointerException - If rawText or text argument is null
      IllegalArgumentException - If rawText or text argument is all whitespace or an empty string. If events, timexes, or links argument is an empty set.
  • Method Details

    • getText

      public String getText()
      Returns the text.
      Specified by:
      getText in interface IText
      Returns:
      the String containing text.
    • getRawText

      public String getRawText()
      Returns the raw text.
      Specified by:
      getRawText in interface IText
      Returns:
      the String containing raw text.
    • getTimexes

      public Set<ITimex> getTimexes()
      Returns the Timex's.
      Specified by:
      getTimexes in interface IText
      Returns:
      the set of Timex's.
    • getLinks

      public Set<ILink> getLinks()
      Returns the links.
      Specified by:
      getLinks in interface IText
      Returns:
      the set of ILinks.
    • getInstances

      public Set<IInstance> getInstances()
      Returns the instances.
      Specified by:
      getInstances in interface IText
      Returns:
      the set of IInstances.
    • getRelatedInstances

      public Set<IInstance> getRelatedInstances(IEvent event)
      Finds and returns the related instances to an event. May be null.
      Specified by:
      getRelatedInstances in interface IText
      Parameters:
      event - the event in question.
      Returns:
      a set of IInstances that are related to a given event.