Package edu.fiu.jtlex.data
Class Disconnectivity
java.lang.Object
edu.fiu.jtlex.data.Disconnectivity
- All Implemented Interfaces:
IDisconnectivity
public class Disconnectivity extends java.lang.Object implements IDisconnectivity
Default implementation of
IDisconnectivity.-
Constructor Summary
Constructors Constructor Description Disconnectivity() -
Method Summary
Modifier and Type Method Description java.lang.StringconvertMonthToHalf(int month)Gets the half the month is bounded to out of the 12 months.java.lang.StringconvertMonthToQuarter(int month)Gets the quarter the month is bounded to out of the 12 months.TimexgetDct(IGraph partition)Gets the document creation timejava.util.ArrayList<ILink>getSuggestedLinks(Graph graph)Returns a list of suggestedLinks to increase graph connectivityjava.util.ArrayList<Timex>getTimeExpressions(IGraph partition)Gets a list of time expressionsbooleanhasDct(IGraph partition)Flags if a partition contains a document creation time.booleanhasTimeExpressions(IGraph partition)Flags if the partition contains time expressions.voidsetSuggestedLinks(ILink x, Graph graph)Sets suggestedLinksjava.lang.StringsuggestedLinksToString(Graph graph)Gets a string representation of the suggested links from the graphvoidsuggestLinks(java.util.ArrayList<IGraph> partitionList, Graph graph)Sends a list of suggested links to the graphILinktrySuggestLink(Timex dct, java.util.ArrayList<Timex> timeExpressions, int numberOfLinks)Attempts to parse a suggested link verifying the tags
-
Constructor Details
-
Disconnectivity
public Disconnectivity()
-
-
Method Details
-
getSuggestedLinks
Returns a list of suggestedLinks to increase graph connectivity- Specified by:
getSuggestedLinksin interfaceIDisconnectivity- Parameters:
graph- a TimeMLGraph- Returns:
- a list of suggestedLinks
-
setSuggestedLinks
Sets suggestedLinks- Parameters:
x- an ILinkgraph- A TimeMLGraph
-
suggestLinks
Sends a list of suggested links to the graph- Specified by:
suggestLinksin interfaceIDisconnectivity- Parameters:
partitionList- the list of suggested linksgraph- the graph of the timeline
-
hasDct
Flags if a partition contains a document creation time.- Specified by:
hasDctin interfaceIDisconnectivity- Parameters:
partition- The graph partition.- Returns:
- True if the partition contains a document creation time, false if it doesn't.
- Throws:
java.lang.IllegalArgumentException- If partition is null
-
hasTimeExpressions
Flags if the partition contains time expressions.- Specified by:
hasTimeExpressionsin interfaceIDisconnectivity- Parameters:
partition- the nodes are processed from the grab the time expressions.- Returns:
- True if the partition contains time expressions, false if it doesn't.
-
getDct
Gets the document creation time- Specified by:
getDctin interfaceIDisconnectivity- Parameters:
partition- the graph partition- Returns:
- document creation time
-
getTimeExpressions
Gets a list of time expressions- Specified by:
getTimeExpressionsin interfaceIDisconnectivity- Parameters:
partition- the nodes are processed from the grab the time expressions- Returns:
- an ArrayList of Timexes
-
trySuggestLink
public ILink trySuggestLink(Timex dct, java.util.ArrayList<Timex> timeExpressions, int numberOfLinks)Attempts to parse a suggested link verifying the tags- Specified by:
trySuggestLinkin interfaceIDisconnectivity- Parameters:
dct- document creation timetimeExpressions- the time expressions parsednumberOfLinks- count of links- Returns:
Linkthe link of the parsed values
-
convertMonthToQuarter
public java.lang.String convertMonthToQuarter(int month)Gets the quarter the month is bounded to out of the 12 months.- Specified by:
convertMonthToQuarterin interfaceIDisconnectivity- Parameters:
month- Month ranging from1-12- Returns:
- The quarter the month is bounded to: Q1-Q2-Q3-Q4
- Throws:
java.lang.IllegalArgumentException- If the month is out of range
-
convertMonthToHalf
public java.lang.String convertMonthToHalf(int month)Gets the half the month is bounded to out of the 12 months.- Specified by:
convertMonthToHalfin interfaceIDisconnectivity- Parameters:
month- Month ranging from1-12- Returns:
- The half the month is bounded to: H1-H2.
- Throws:
java.lang.IllegalArgumentException- If the month is out of range
-
suggestedLinksToString
Gets a string representation of the suggested links from the graph- Specified by:
suggestedLinksToStringin interfaceIDisconnectivity- Parameters:
graph- bounded graph to the suggested links- Returns:
- the string representation of the suggested links.
-