|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.ObjectSynset
class Synset
Access to DOM elements of the XML version of WordNet The only instance variable is a reference to the DOM element, the other methods create dynamic instances by searching the DOM structure
| Field Summary | |
|---|---|
(package private) org.w3c.dom.Element |
element
|
private static java.util.Map<java.lang.String,Synset> |
id2synset
|
private static java.util.List<java.util.Map<java.lang.String,java.util.List<Synset>>> |
lemma2synsets
|
static java.lang.String |
POS
|
| Constructor Summary | |
|---|---|
private |
Synset(org.w3c.dom.Element node)
|
| Method Summary | |
|---|---|
private java.lang.String |
attribute(java.lang.String name)
Return the value of the attribute of the given name for this synset |
private java.util.List<org.w3c.dom.Element> |
child(java.lang.String name)
Return the list of elements matching a name |
static Synset |
fromId(java.lang.String id)
Return the DOM element corresponding to a synset for an id |
static java.util.List<Synset> |
fromWord(char pos,
java.lang.String word)
Return the DOM element corresponding to a synset in a part of speech for a lemma |
static java.util.List<Synset> |
fromWord(java.lang.String pos,
java.lang.String word)
Return the DOM element corresponding to a synset in a part of speech for a lemma |
java.util.List<java.lang.String> |
getDefs()
Get the list of def elements of this synset |
java.util.List<java.lang.String> |
getExamples()
Get the list examples elements of this synset |
java.util.List<Frame> |
getFrames()
Get the list of frame elements of this synset |
java.lang.String |
getId()
Get the value of the id attribute of the synset |
int |
getLex_filenum()
Get the value of the lex_filenum element of the synset |
java.util.List<Pointer> |
getPointers(java.lang.String pointer_type)
Get the list of pointer elements of a given type for this synset |
java.lang.String |
getType()
Get the value of the type attribute of the synset |
java.util.List<Word> |
getWords()
Get the list of the word elements of the synset |
static java.util.SortedSet<java.lang.String> |
grep(java.lang.String pos,
java.lang.String regexp)
Get the list of all lemmas of a given pos with a word matching a given regular expression |
static void |
init(org.w3c.dom.Element dataDocElement,
org.w3c.dom.Element indexDocElement)
Initialise the maps for efficient indexing by id or lemma |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private static java.util.Map<java.lang.String,Synset> id2synset
private static java.util.List<java.util.Map<java.lang.String,java.util.List<Synset>>> lemma2synsets
public static java.lang.String POS
org.w3c.dom.Element element
| Constructor Detail |
|---|
private Synset(org.w3c.dom.Element node)
| Method Detail |
|---|
public static void init(org.w3c.dom.Element dataDocElement,
org.w3c.dom.Element indexDocElement)
dataDocElement - DOM structure for data.xmlindexDocElement - DOM structure for index.xmlpublic static Synset fromId(java.lang.String id)
id - the id of the synset
public static java.util.List<Synset> fromWord(char pos,
java.lang.String word)
pos - part of speech as charword - lemma
public static java.util.List<Synset> fromWord(java.lang.String pos,
java.lang.String word)
pos - part of speech as Stringword - lemma
public java.lang.String toString()
toString in class java.lang.Objectprivate java.lang.String attribute(java.lang.String name)
name - name of attribute
private java.util.List<org.w3c.dom.Element> child(java.lang.String name)
name - regexp of the element(s) name
public java.lang.String getId()
public java.lang.String getType()
public int getLex_filenum()
public java.util.List<Word> getWords()
public java.util.List<Pointer> getPointers(java.lang.String pointer_type)
pointer_type - regexp for the name of the pointers searched for
public java.util.List<Frame> getFrames()
public java.util.List<java.lang.String> getDefs()
public java.util.List<java.lang.String> getExamples()
public static java.util.SortedSet<java.lang.String> grep(java.lang.String pos,
java.lang.String regexp)
pos - part of speechregexp - regular expressing to match as a word
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||