Package edu.fiu.jtlex.data
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
-
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.StringgetRawText()Returns the raw text.java.util.Set<IInstance>getRelatedInstances(IEvent event)Finds and returns the related instances to an event.java.lang.StringgetText()Returns the text.java.util.Set<ITimex>getTimexes()Returns the Timex's.
-
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 benulltext- Article text without the tags. May not benull.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 isnulljava.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. -
getRawText
public java.lang.String getRawText()Returns the raw text.- Specified by:
getRawTextin interfaceIText- Returns:
- the String containing raw text.
-
getTimexes
Returns the Timex's.- Specified by:
getTimexesin interfaceIText- Returns:
- the set of Timex's.
-
getLinks
Returns the links. -
getInstances
Returns the instances.- Specified by:
getInstancesin interfaceIText- Returns:
- the set of IInstances.
-
getRelatedInstances
Finds and returns the related instances to an event.- Specified by:
getRelatedInstancesin interfaceIText- Parameters:
event- the event in question.- Returns:
- a set of IInstances that are related to a given event.
-