|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjcolibri.extensions.textual.wordnet.WordNetBridge
public class WordNetBridge
WordNet wrapper that loads the dictionary into memory without having to install it in the file system. The JColibriPrincetonObjectDictionary is a modification of the WordNet original dictionary that allows to load the dictionary from the class-path or jar file into memory. That avoids having to install wordnet in the file system.
To avoid memory problems use the -Xms -Xmx VM params. For example to use a max of 1Gb of memory use: -Xms256m -Xmx1024m
Nested Class Summary | |
---|---|
static class |
WordNetBridge.POS
Part-Of-Speech tags |
Constructor Summary | |
---|---|
WordNetBridge()
|
Method Summary | |
---|---|
static void |
deInit()
Releases all resources and dictionaries |
static java.lang.String[] |
getChildren(java.lang.String word,
WordNetBridge.POS pos)
Get all of the childrens of a word |
static java.lang.String[] |
getParents(java.lang.String word,
WordNetBridge.POS pos)
Get all of the hypernyms (parents) of a word |
static int |
hypernymDistance(java.lang.String w1,
WordNetBridge.POS pos1,
java.lang.String w2,
WordNetBridge.POS pos2)
Distance between two words using the Hypernym relationship |
static void |
init()
Initializes WordNet loading everything into memory. |
static void |
main(java.lang.String[] args)
Test case. |
static boolean |
sameSynset(java.lang.String w1,
WordNetBridge.POS pos1,
java.lang.String w2,
WordNetBridge.POS pos2)
Checks if two words are in the same synset when the have the given POS tag |
static int |
similarToDistance(java.lang.String w1,
WordNetBridge.POS pos1,
java.lang.String w2,
WordNetBridge.POS pos2)
Distance between two words using the SimilarTo relationship |
static java.lang.String[] |
SynsetWords(java.lang.String word,
WordNetBridge.POS posw)
Returs a list of words in the same synset that the given word |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public WordNetBridge()
Method Detail |
---|
public static void init()
public static void deInit()
public static boolean sameSynset(java.lang.String w1, WordNetBridge.POS pos1, java.lang.String w2, WordNetBridge.POS pos2)
w1
- word 1pos1
- POS tag of word 1w2
- word 2pos2
- POS tag of word 2public static java.lang.String[] SynsetWords(java.lang.String word, WordNetBridge.POS posw)
word
- word to find the synsetposw
- POS tag of the wordpublic static java.lang.String[] getParents(java.lang.String word, WordNetBridge.POS pos)
public static java.lang.String[] getChildren(java.lang.String word, WordNetBridge.POS pos)
public static int similarToDistance(java.lang.String w1, WordNetBridge.POS pos1, java.lang.String w2, WordNetBridge.POS pos2)
public static int hypernymDistance(java.lang.String w1, WordNetBridge.POS pos1, java.lang.String w2, WordNetBridge.POS pos2)
public static void main(java.lang.String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |