edu.princeton.wordnet.ejb
Class Mapping

java.lang.Object
  extended by edu.princeton.wordnet.ejb.Mapping

public class Mapping
extends java.lang.Object

Id-name mappings

Author:
Bernard Bou

Field Summary
static int ANYTYPE
          is the constant for unspecified search types (pos, categories, links)
static int NONRECURSIVE
          is the constant for non recursive queries
static int theHyponymId
          theHyponymId is id for hyponym relation
static int theInstanceHyponymId
          theInstanceHyponymId is id for instance hyponym relation
static int theTopsCategory
          theTopsCategory is a constant for Tops category id
 
Constructor Summary
Mapping()
           
 
Method Summary
static boolean canRecurse(int thisLinkType)
          Determine if this link can recurse
static int getCategoryId(java.lang.String thisPosName, java.lang.String thisCategoryName)
          Find category id from part-of-speech name and category name
static java.lang.String getCategoryName(int thisCategoryId)
          Find category name from category id
static java.lang.String getLinkName(int thisLinkType)
          Find link name from link id
static int getLinkType(java.lang.String thisLinkName)
          Find link id from link name
static int getPosId(java.lang.String thisPosName)
          Find part-of-speech id (n,v,a,r) from part-of-speech name
static java.lang.String getPosName(int thisCategoryId)
          Find part-of-speech name from category id
static void init(java.sql.Connection thisConnection)
          Read mappings from database
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

theTopsCategory

public static final int theTopsCategory
theTopsCategory is a constant for Tops category id

See Also:
Constant Field Values

theHyponymId

public static final int theHyponymId
theHyponymId is id for hyponym relation

See Also:
Constant Field Values

theInstanceHyponymId

public static final int theInstanceHyponymId
theInstanceHyponymId is id for instance hyponym relation

See Also:
Constant Field Values

ANYTYPE

public static final int ANYTYPE
is the constant for unspecified search types (pos, categories, links)

See Also:
Constant Field Values

NONRECURSIVE

public static final int NONRECURSIVE
is the constant for non recursive queries

See Also:
Constant Field Values
Constructor Detail

Mapping

public Mapping()
Method Detail

init

public static void init(java.sql.Connection thisConnection)
                 throws javax.ejb.EJBException
Read mappings from database

Parameters:
thisConnection - is the database connection
Throws:
javax.ejb.EJBException

getPosName

public static java.lang.String getPosName(int thisCategoryId)
Find part-of-speech name from category id

Parameters:
thisCategoryId - is the category id
Returns:
part-of-speech name

getCategoryName

public static java.lang.String getCategoryName(int thisCategoryId)
Find category name from category id

Parameters:
thisCategoryId - is the category id
Returns:
category name or "categoryid.xxx" if not found

getCategoryId

public static int getCategoryId(java.lang.String thisPosName,
                                java.lang.String thisCategoryName)
Find category id from part-of-speech name and category name

Parameters:
thisPosName - is the target part-of-speech name
thisCategoryName - is the target category name
Returns:
category id or -1 if not found

getPosId

public static int getPosId(java.lang.String thisPosName)
Find part-of-speech id (n,v,a,r) from part-of-speech name

Parameters:
thisPosName - is the target part-of-speech name
Returns:
part-of-speech id or ANYTYPE if not found

getLinkName

public static java.lang.String getLinkName(int thisLinkType)
Find link name from link id

Parameters:
thisLinkType - is the target link id
Returns:
link name or "linktype.xxx" if not found

getLinkType

public static int getLinkType(java.lang.String thisLinkName)
Find link id from link name

Parameters:
thisLinkName - is the target link name
Returns:
link id or ANYTYPE if it is not found

canRecurse

public static boolean canRecurse(int thisLinkType)
Determine if this link can recurse

Parameters:
thisLinkType - is the target link id
Returns:
whether this link type can recurse