Class DisconnectivityProcessor

java.lang.Object
edu.fiu.jtlex.algorithms.DisconnectivityProcessor
All Implemented Interfaces:
IDisconnectivityProcessor

public class DisconnectivityProcessor extends Object implements IDisconnectivityProcessor
Default implementation of IDisconnectivityProcessor
Since:
jTLEX 1.0
See Also:
  • Constructor Details

    • DisconnectivityProcessor

      public DisconnectivityProcessor()
      Creates a new instance
      Since:
      jTLEX 1.0
  • Method Details

    • getDct

      public TimeMLTimex getDct(ITimeMLGraph partition)
      Gets the document creation time
      Specified by:
      getDct in interface IDisconnectivityProcessor
      Parameters:
      partition - The graph partition
      Returns:
      The document creation time
      Throws:
      NullPointerException - If the partition is null
      Since:
      jTLEX 1.0
    • hasDct

      public boolean hasDct(ITimeMLGraph partition)
      Flags if a partition contains a document creation time.
      Specified by:
      hasDct in interface IDisconnectivityProcessor
      Parameters:
      partition - The graph partition.
      Returns:
      True if the partition contains a document creation time, false if it doesn't.
      Throws:
      NullPointerException - If partition is null
      Since:
      jTLEX 1.0
    • hasTimeExpressions

      public boolean hasTimeExpressions(ITimeMLGraph partition)
      Flags if the partition contains time expressions.
      Specified by:
      hasTimeExpressions in interface IDisconnectivityProcessor
      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.
      Throws:
      NullPointerException - If partition is null
      Since:
      jTLEX 1.0
    • getTimeExpressions

      public List<TimeMLTimex> getTimeExpressions(ITimeMLGraph partition)
      Gets a list of time expressions
      Specified by:
      getTimeExpressions in interface IDisconnectivityProcessor
      Parameters:
      partition - the nodes are processed from the grab the time expressions
      Returns:
      A List of timexes
      Throws:
      NullPointerException - If partition is null
      Since:
      jTLEX 1.0
    • suggestLinks

      public List<ITimeMLLink> suggestLinks(List<ITimeMLGraph> partitions, int linksCount)
      Suggests a list of possible links that might connect the partition with date creation time with the other partitions. Only one link per partitions pair is suggested.

      TODO: Is it possible to keep track of which partitions the link is connecting?

      Specified by:
      suggestLinks in interface IDisconnectivityProcessor
      Parameters:
      partitions - A List of partitions
      linksCount - The number of links in the graph
      Returns:
      A List with the suggested links to increase connectivity
      Throws:
      IllegalArgumentException - If the graph does not have a date creation time tag.
      Since:
      jTLEX 1.0
    • convertMonthToQuarter

      public String convertMonthToQuarter(int month)
      Gets the quarter the month is bounded to out of the 12 months.
      Specified by:
      convertMonthToQuarter in interface IDisconnectivityProcessor
      Parameters:
      month - Month ranging from 1-12
      Returns:
      The quarter the month is bounded to: Q1-Q2-Q3-Q4
      Throws:
      IllegalArgumentException - If the month is out of range
      Since:
      jTLEX 1.0
    • convertMonthToHalf

      public String convertMonthToHalf(int month)
      Gets the half the month is bounded to out of the 12 months.
      Specified by:
      convertMonthToHalf in interface IDisconnectivityProcessor
      Parameters:
      month - Month ranging from 1-12
      Returns:
      The half the month is bounded to: H1-H2.
      Throws:
      IllegalArgumentException - If the month is out of range
      Since:
      jTLEX 1.0