cic.wordnet
Class Relation

java.lang.Object
  extended by cic.wordnet.Relation

public class Relation
extends java.lang.Object

Class to store a semantic relation contained in WordNet.

Author:
Francisco Viveros-Jiménez

Field Summary
(package private)  java.lang.String pos
          The POS tag for the related synset.
(package private)  java.lang.String sid
          The synsetId of the related synset. sid is in the format "number_P".
(package private)  int source
          Index of the source synset word related to this relation.
(package private)  int target
          Index of the related synset word related to this relation.
(package private)  java.lang.String type
          Corresponding relation type of the WNtype, e.g., "hypernym".
(package private)  java.lang.String WNtype
          WordNet code of this relation, e.g., "@" for hypernyms.
 
Constructor Summary
Relation(java.lang.String WNType, java.lang.String sid, java.lang.String pos, java.lang.String source_target)
          Creates a relation from WordNet info.
 
Method Summary
 java.lang.String getPos()
          Returns the POS tag of the target synset.
 java.lang.String getSid()
          Returns the synsetId of the target synset.
 int getSource()
          Returns the index of the source synset word related to this relation.
 int getTarget()
          Returns the index of the related synset word related to this relation.
 java.lang.String getType()
          Returns the type of this relation.
 java.lang.String getWNtype()
          Returns the WordNet code of this relation.
 java.lang.String toString()
          Returns "has relation: synsetId".
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

WNtype

java.lang.String WNtype
WordNet code of this relation, e.g., "@" for hypernyms. See Wordnet's wninput(5WN) page for further details.


type

java.lang.String type
Corresponding relation type of the WNtype, e.g., "hypernym".


sid

java.lang.String sid
The synsetId of the related synset. sid is in the format "number_P".


pos

java.lang.String pos
The POS tag for the related synset.


source

int source
Index of the source synset word related to this relation.


target

int target
Index of the related synset word related to this relation.

Constructor Detail

Relation

public Relation(java.lang.String WNType,
                java.lang.String sid,
                java.lang.String pos,
                java.lang.String source_target)
Creates a relation from WordNet info. See WordNet's wndb(5WN) page for further details.

Parameters:
WNType - Relation code.
sid - Target synsetId as found in WordNet.
pos - POS tag as found in WordNet.
source_target - source_target string.
Method Detail

getWNtype

public java.lang.String getWNtype()
Returns the WordNet code of this relation.

Returns:
WNtype

getType

public java.lang.String getType()
Returns the type of this relation.

Returns:
type

getSid

public java.lang.String getSid()
Returns the synsetId of the target synset.

Returns:
sid

getPos

public java.lang.String getPos()
Returns the POS tag of the target synset.

Returns:
pos

getSource

public int getSource()
Returns the index of the source synset word related to this relation.

Returns:
source

getTarget

public int getTarget()
Returns the index of the related synset word related to this relation.

Returns:
target

toString

public java.lang.String toString()
Returns "has relation: synsetId". E.g., has Antonym: 00002098_J.

Overrides:
toString in class java.lang.Object