Class Text

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

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

    Constructors 
    Constructor Description
    Text​(java.lang.String rawText, java.lang.String text, java.util.Set<ITimex> timexes, java.util.Set<ILink> links, java.util.Set<IInstance> instances)
    Creates a new Text object.
  • Method Summary

    Modifier and Type Method Description
    java.util.Set<IInstance> getInstances()
    Returns the instances.
    java.util.Set<ILink> getLinks()
    Returns the links.
    java.lang.String getRawText()
    Returns the raw text.
    java.util.Set<IInstance> getRelatedInstances​(IEvent event)
    Finds and returns the related instances to an event.
    java.lang.String getText()
    Returns the text.
    java.util.Set<ITimex> getTimexes()
    Returns the Timex's.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Text

      public Text​(java.lang.String rawText, java.lang.String text, java.util.Set<ITimex> timexes, java.util.Set<ILink> links, java.util.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:
      java.lang.NullPointerException - If rawText or text argument is null
      java.lang.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 java.lang.String getText()
      Returns the text.
      Specified by:
      getText in interface IText
      Returns:
      the String containing text.
    • getRawText

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

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

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

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

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