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.String convertMonthToHalf​(int month)
    Gets the half the month is bounded to out of the 12 months.
    java.lang.String convertMonthToQuarter​(int month)
    Gets the quarter the month is bounded to out of the 12 months.
    Timex getDct​(IGraph partition)
    Gets the document creation time
    java.util.ArrayList<ILink> getSuggestedLinks​(Graph graph)
    Returns a list of suggestedLinks to increase graph connectivity
    java.util.ArrayList<Timex> getTimeExpressions​(IGraph partition)
    Gets a list of time expressions
    boolean hasDct​(IGraph partition)
    Flags if a partition contains a document creation time.
    boolean hasTimeExpressions​(IGraph partition)
    Flags if the partition contains time expressions.
    void setSuggestedLinks​(ILink x, Graph graph)
    Sets suggestedLinks
    java.lang.String suggestedLinksToString​(Graph graph)
    Gets a string representation of the suggested links from the graph
    void suggestLinks​(java.util.ArrayList<IGraph> partitionList, Graph graph)
    Sends a list of suggested links to the graph
    ILink trySuggestLink​(Timex dct, java.util.ArrayList<Timex> timeExpressions, int numberOfLinks)
    Attempts to parse a suggested link verifying the tags

    Methods inherited from class java.lang.Object

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

  • Method Details

    • getSuggestedLinks

      public java.util.ArrayList<ILink> getSuggestedLinks​(Graph graph)
      Returns a list of suggestedLinks to increase graph connectivity
      Specified by:
      getSuggestedLinks in interface IDisconnectivity
      Parameters:
      graph - a TimeMLGraph
      Returns:
      a list of suggestedLinks
    • setSuggestedLinks

      public void setSuggestedLinks​(ILink x, Graph graph)
      Sets suggestedLinks
      Parameters:
      x - an ILink
      graph - A TimeMLGraph
    • suggestLinks

      public void suggestLinks​(java.util.ArrayList<IGraph> partitionList, Graph graph)
      Sends a list of suggested links to the graph
      Specified by:
      suggestLinks in interface IDisconnectivity
      Parameters:
      partitionList - the list of suggested links
      graph - the graph of the timeline
    • hasDct

      public boolean hasDct​(IGraph partition)
      Flags if a partition contains a document creation time.
      Specified by:
      hasDct in interface IDisconnectivity
      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

      public boolean hasTimeExpressions​(IGraph partition)
      Flags if the partition contains time expressions.
      Specified by:
      hasTimeExpressions in interface IDisconnectivity
      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

      public Timex getDct​(IGraph partition)
      Gets the document creation time
      Specified by:
      getDct in interface IDisconnectivity
      Parameters:
      partition - the graph partition
      Returns:
      document creation time
    • getTimeExpressions

      public java.util.ArrayList<Timex> getTimeExpressions​(IGraph partition)
      Gets a list of time expressions
      Specified by:
      getTimeExpressions in interface IDisconnectivity
      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:
      trySuggestLink in interface IDisconnectivity
      Parameters:
      dct - document creation time
      timeExpressions - the time expressions parsed
      numberOfLinks - count of links
      Returns:
      Link the 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:
      convertMonthToQuarter in interface IDisconnectivity
      Parameters:
      month - Month ranging from 1-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:
      convertMonthToHalf in interface IDisconnectivity
      Parameters:
      month - Month ranging from 1-12
      Returns:
      The half the month is bounded to: H1-H2.
      Throws:
      java.lang.IllegalArgumentException - If the month is out of range
    • suggestedLinksToString

      public java.lang.String suggestedLinksToString​(Graph graph)
      Gets a string representation of the suggested links from the graph
      Specified by:
      suggestedLinksToString in interface IDisconnectivity
      Parameters:
      graph - bounded graph to the suggested links
      Returns:
      the string representation of the suggested links.