ca.site.elkb
Class Path

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

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

Represents a path in Roget's Thesaurus between two words or phrases. This is mostly used in an old version of SemDist and may not be too useful.

Version:
1.4 2013
Author:
Mario Jarmasz and Alistsair Kennedy

Constructor Summary
Path()
          Default constructor.
Path(java.util.ArrayList<java.lang.String> path)
          Constructor that initialized this Path object with a Path.
 
Method Summary
 int compareTo(java.lang.Object other)
          Compares two paths.
 java.lang.String getKeyWord1()
          Returns the keyword of the the first word or phrase in this Path.
 java.lang.String getKeyWord2()
          Returns the keyword of the the second word or phrase in this Path.
 java.lang.String getPath()
          Returns the path between the first and second word or phrase.
 java.lang.String getPathInfo1()
          Returns the location in the ontology of the first word or phrase in this Path.
 java.lang.String getPathInfo2()
          Returns the location in the ontology of the second word or phrase in this Path.
 java.lang.String getPos1()
          Returns the part-of-speech of the the first word or phrase in this Path.
 java.lang.String getPos2()
          Returns the part-of-speech of the the second word or phrase in this Path.
 java.lang.String getWord1()
          Returns the first word or phrase in this Path.
 java.lang.String getWord2()
          Returns the second word or phrase in this Path.
 int length()
          Returns the number of elements in this Path.
 int size()
          Returns the length in this Path.
 java.lang.String toString()
          Converts to a string representation the Path object.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Path

public Path()
Default constructor.


Path

public Path(java.util.ArrayList<java.lang.String> path)
Constructor that initialized this Path object with a Path.

Parameters:
path -
Method Detail

length

public int length()
Returns the number of elements in this Path.

Returns:
length of path

size

public int size()
Returns the length in this Path. Size is length - 1.

Returns:
length of path - 1

compareTo

public int compareTo(java.lang.Object other)
Compares two paths. They are first compared according to their length. If they are still equal, they are then sorted according to keywords.

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

getKeyWord1

public java.lang.String getKeyWord1()
Returns the keyword of the the first word or phrase in this Path.

Returns:
key word 1

getPos1

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

Returns:
POS of word 1

getKeyWord2

public java.lang.String getKeyWord2()
Returns the keyword of the the second word or phrase in this Path.

Returns:
key word 2

getPos2

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

Returns:
POS of word 2

getPathInfo1

public java.lang.String getPathInfo1()
Returns the location in the ontology of the first word or phrase in this Path.

Returns:
path info 1

getPathInfo2

public java.lang.String getPathInfo2()
Returns the location in the ontology of the second word or phrase in this Path.

Returns:
path info 2

getWord1

public java.lang.String getWord1()
Returns the first word or phrase in this Path.

Returns:
word 1

getWord2

public java.lang.String getWord2()
Returns the second word or phrase in this Path.

Returns:
word 2

getPath

public java.lang.String getPath()
Returns the path between the first and second word or phrase.

Returns:
path

toString

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

Overrides:
toString in class java.lang.Object