ca.site.elkb
Class PathSet

java.lang.Object
  extended by ca.site.elkb.PathSet
All Implemented Interfaces:
java.lang.Comparable<java.lang.Object>

public class PathSet
extends java.lang.Object
implements java.lang.Comparable<java.lang.Object>

A set that contains all of the paths between two words and phrases as well as the number of minimum length paths. This class is used to measure semantic distance.

The PathSet also contains the original strings before any morphological transformations of modifications of phrases These are contained in origWord1 and origWord2.

Version:
1.4 2013
Author:
Mario Jarmasz and Alistsair Kennedy

Constructor Summary
PathSet()
          Default constructor.
PathSet(java.util.TreeSet<Path> pathSet)
          Constructor that initialized this PathSet object with a PathSet.
 
Method Summary
 void calculatePathAdjustment()
          The pathAdjustment is a value between 0 and 2 It is the sum of the lengths of all paths, divided by the total number of paths.
 int compareTo(java.lang.Object other)
          Compares two PathSets according to the length of the shortest path.
 java.util.TreeSet<Path> getAllPaths()
          Returns all Paths in this PathSet.
 int getCTotal()
          CTotal represents the number of paths of minimum length This value is used to break ties between words and phrases which have the same semantic distance value using edge-counting.
 int getMinLength()
          Returns the length of the shortest Path in this PathSet.
 int getMinPathCount()
          Returns the number of minimum length Paths in this PathSet.
 java.lang.String getOrigWord1()
          Returns the original form of the first word or phrase in this PathSet.
 java.lang.String getOrigWord2()
          Returns the original form of the second word or phrase in this PathSet.
 float getPathAdjustment()
          returns the Path Adjustment.
 java.lang.String getPos1()
          Returns the part-of-speech of the first word or phrase in this PathSet.
 java.lang.String getPos2()
          Returns the part-of-speech of the second word or phrase in this PathSet.
 java.lang.String getWord1()
          Returns the first word or phrase after the morphological transformations are applied in this PathSet.
 java.lang.String getWord2()
          Returns the second word or phrase after the morphological transformations are applied in this PathSet.
 java.lang.String getWordPair()
          Converts to a string representation the PathSet object - used for debugging.
 void setOrigWord1(java.lang.String word)
          Sets the original form of the first word or phrase in this PathSet.
 void setOrigWord2(java.lang.String word)
          Sets the original form of the second word or phrase in this PathSet.
 java.lang.String toString()
          Converts to a string representation the PathSet object.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PathSet

public PathSet()
Default constructor.


PathSet

public PathSet(java.util.TreeSet<Path> pathSet)
Constructor that initialized this PathSet object with a PathSet.

Parameters:
pathSet -
Method Detail

calculatePathAdjustment

public void calculatePathAdjustment()
The pathAdjustment is a value between 0 and 2 It is the sum of the lengths of all paths, divided by the total number of paths. This gives a value between 0 and 16. It is therefore divided by 8 to obtain the pathAdjustment.


getCTotal

public int getCTotal()
CTotal represents the number of paths of minimum length This value is used to break ties between words and phrases which have the same semantic distance value using edge-counting. The pair of words or phrases which have the largest CTotal is considered to be more similar.

Returns:
number of paths

getAllPaths

public java.util.TreeSet<Path> getAllPaths()
Returns all Paths in this PathSet.

Returns:
TreeSet of paths

getMinPathCount

public int getMinPathCount()
Returns the number of minimum length Paths in this PathSet.

Returns:
count of shortest paths

getMinLength

public int getMinLength()
Returns the length of the shortest Path in this PathSet.

Returns:
shortest path length

getPathAdjustment

public float getPathAdjustment()
returns the Path Adjustment.

Returns:
path adjustment

getWord1

public java.lang.String getWord1()
Returns the first word or phrase after the morphological transformations are applied in this PathSet.

Returns:
word 1

getWord2

public java.lang.String getWord2()
Returns the second word or phrase after the morphological transformations are applied in this PathSet.

Returns:
word 2

getPos1

public java.lang.String getPos1()
Returns the part-of-speech of the first word or phrase in this PathSet.

Returns:
POS 1

getPos2

public java.lang.String getPos2()
Returns the part-of-speech of the second word or phrase in this PathSet.

Returns:
POS 2

compareTo

public int compareTo(java.lang.Object other)
Compares two PathSets according to the length of the shortest path. If there is a tie, try the following in sequence:

Specified by:
compareTo in interface java.lang.Comparable<java.lang.Object>

getWordPair

public java.lang.String getWordPair()
Converts to a string representation the PathSet object - used for debugging. Returns the words and phrases used in the PathSet as well as their parts-of-speech.

Returns:
word pair

toString

public java.lang.String toString()
Converts to a string representation the PathSet object.

Overrides:
toString in class java.lang.Object

getOrigWord1

public java.lang.String getOrigWord1()
Returns the original form of the first word or phrase in this PathSet.

Returns:
Original word 1

setOrigWord1

public void setOrigWord1(java.lang.String word)
Sets the original form of the first word or phrase in this PathSet.

Parameters:
word -

getOrigWord2

public java.lang.String getOrigWord2()
Returns the original form of the second word or phrase in this PathSet.

Returns:
Original word 2

setOrigWord2

public void setOrigWord2(java.lang.String word)
Sets the original form of the second word or phrase in this PathSet.

Parameters:
word -