|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectgov.llnl.ontology.wordnet.BaseSynset
public class BaseSynset
The core Synset implementation when interfacing directly with the
word net dictionary files. This implementation satisfies all of the
requirements of a Synset and allows the Synset to be
re-serialized in the proper word net form.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface gov.llnl.ontology.wordnet.Synset |
|---|
Synset.PartsOfSpeech, Synset.Relation |
| Constructor Summary | |
|---|---|
BaseSynset(int offset,
Synset.PartsOfSpeech pos)
Creates a BaseSynset with a byte offset value. |
|
BaseSynset(String synsetName)
Creates a BaseSynset with a byte offset value. |
|
BaseSynset(Synset.PartsOfSpeech pos)
Creates an empty BaseSynset. |
|
| Method Summary | |
|---|---|
void |
addDerivationallyRelatedForm(Synset related,
RelatedForm form)
Adds a RelatedForm to this Synset, signifiying that the
two Synsets share a Lemma that are closely related. |
void |
addExample(String example)
Adds an example sentence detailing how this lemmas for this Synset are used in everday speech. |
void |
addLemma(Lemma lemma)
Adds a Lemma to this Synset. |
void |
addMorphyMapping(String original,
String lemma)
|
boolean |
addRelation(String relation,
Synset synset)
Returns true if a new relation is added between this and
related by relation. |
boolean |
addRelation(Synset.Relation relation,
Synset synset)
Returns true if a new relation is added between this and
related by relation. |
void |
addSenseKey(String senseKey)
Sets the unique sense key string. |
Collection<Synset> |
allRelations()
Returns the set of all Synsets that are connected to this Synset, regardless of the relation type. |
Set<String> |
attributeLabels()
Returns the set of Attribute keys currently held by this Synset. |
Attribute |
getAttribute(String attributeName)
Returns the Attribute associated with the label attributeName applied to this Synset, or null if there
is no associated attribute. |
Set<Synset> |
getChildren()
Returns the Synsets that are more specific concepts of this
Synset. |
String |
getDefinition()
Returns the dictionary definition of this Synset |
RelatedForm |
getDerivationallyRelatedForm(Synset synset)
Returns a if the provided Synset has a Lemma which is a derivationally related form of a Lemma from
this Synset, or null if there is no relation. |
List<String> |
getExamples()
Returns the set of example sentences which explain how this Synset is used in regular text. |
int[] |
getFrameIds()
Returns the frame indices for all known verb frames for this synset. |
String |
getGloss()
Returns the complete gloss, i.e., all definitions and examples. |
int |
getId()
Returns the integer identifier used to initially reference this synset within the WordNet dictionary files. |
Set<String> |
getKnownRelationTypes()
Returns the set of relation keys that this Synset has with other
Synsets. |
int[] |
getLemmaIds()
Returns the lemma indices for all known verb frames for this synset. |
List<Lemma> |
getLemmas()
Returns the list of Lemmas that correspond to this Synset. |
int |
getMaxDepth()
Returns the maximum distance between this Synset and the root
Synset. |
int |
getMinDepth()
Returns the minimum distance between this Synset and the root
Synset. |
String |
getName()
Returns a unique string that identifies this Synset. |
int |
getNumRelations()
Returns the total number of known relations for this synset. |
List<List<Synset>> |
getParentPaths()
Returns a list of all paths from the current Synset to the root
of the IS-A hierarchy. |
Set<Synset> |
getParents()
Returns the Synsets that are generalized concepts of this Synset. |
Synset.PartsOfSpeech |
getPartOfSpeech()
Returns the Synset.PartsOfSpeech attributed to this Synset |
Set<Synset> |
getRelations(String relation)
Returns the set of Synsets that are connected to this Synset through the specified relation string. |
Set<Synset> |
getRelations(Synset.Relation relation)
Returns the set of Synsets that are connected to this Synset through the specified Synset.Relation. |
String |
getSenseKey()
Returns the first unique string that identifies this Synset based
on it's part of speech, lexicographer file assignment and index in the
lexicographer's file. |
String |
getSenseKey(String base)
Returns a unique string that identifies this Synset based on it's
part of speech, the base query term, the lexicographer file
assignment and index in the lexicographer's file. |
List<String> |
getSenseKeys()
Returns all sense keys associated with this Synset. |
int |
getSenseNumber()
Returns the sense number for this Synset. |
void |
merge(Synset synset)
Merges this Synset with the provided Synset. |
boolean |
removeRelation(String relation,
Synset synset)
Returns true if a relation between this and related by the link relation was removed. |
boolean |
removeRelation(Synset.Relation relation,
Synset synset)
Returns true if a relation between this and related by the link relation was removed. |
void |
setAttribute(String attributeName,
Attribute attribute)
Sets attribute as an object that described this Synset
with more detail. |
void |
setDefinition(String definition)
Sets dictionary definition for this Synset. |
void |
setFrameInfo(int[] frameIds,
int[] lemmaIds)
Sets the indices for frames and lemmas for this synset. |
void |
setId(int newOffset)
Sets the id for a given Synset. |
void |
setSenseNumber(int senseNumber)
Sets the sense number for this Synset. |
String |
toString()
Returns this Synsets name and gloss. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public BaseSynset(String synsetName)
BaseSynset with a byte offset value.
public BaseSynset(int offset,
Synset.PartsOfSpeech pos)
BaseSynset with a byte offset value.
public BaseSynset(Synset.PartsOfSpeech pos)
BaseSynset.
| Method Detail |
|---|
public void addMorphyMapping(String original,
String lemma)
addMorphyMapping in interface Synsetpublic int getSenseNumber()
Synset. Sense numbers may be
modified whenever a Synset is added, removed, or merged.
getSenseNumber in interface Synsetpublic void setSenseNumber(int senseNumber)
Synset. Sense numbers may be
modified whenever a Synset is added, removed, or merged.
setSenseNumber in interface Synsetpublic String getName()
Synset. This name
should be based on one of the Synset's lemmas, the part of
speech, and the sense number for this Synset. For example,
"cat.n.01" signifies that the Synset is a noun and corresponds to
the first sense of the "cat" Lemma.
getName in interface Synsetpublic String getSenseKey()
Synset based
on it's part of speech, lexicographer file assignment and index in the
lexicographer's file. This is often the same as the lemma key of the
Synset's first Lemma.
getSenseKey in interface Synsetpublic String getSenseKey(String base)
Synset based on it's
part of speech, the base query term, the lexicographer file
assignment and index in the lexicographer's file. This is often the same
as the lemma key of the Synset's first Lemma.
getSenseKey in interface Synsetpublic List<String> getSenseKeys()
Synset.
getSenseKeys in interface Synsetpublic void addSenseKey(String senseKey)
addSenseKey in interface Synsetpublic String getDefinition()
Synset
getDefinition in interface Synsetpublic Synset.PartsOfSpeech getPartOfSpeech()
Synset.PartsOfSpeech attributed to this Synset
getPartOfSpeech in interface Synsetpublic List<Lemma> getLemmas()
Lemmas that correspond to this Synset.
getLemmas in interface Synsetpublic List<String> getExamples()
Synset is used in regular text.
getExamples in interface Synsetpublic RelatedForm getDerivationallyRelatedForm(Synset synset)
Synset has a Lemma which is a derivationally related form of a Lemma from
this Synset, or null if there is no relation.
getDerivationallyRelatedForm in interface Synsetpublic Set<String> getKnownRelationTypes()
Synset has with other
Synsets. In general these keys will be string versions of Synset.Relations.
getKnownRelationTypes in interface Synsetpublic Collection<Synset> allRelations()
Synsets that are connected to this Synset, regardless of the relation type.
allRelations in interface Synsetpublic Set<Synset> getRelations(String relation)
Synsets that are connected to this Synset through the specified relation string.
getRelations in interface Synsetpublic Set<Synset> getRelations(Synset.Relation relation)
Synsets that are connected to this Synset through the specified Synset.Relation.
getRelations in interface Synsetpublic int getNumRelations()
getNumRelations in interface Synsetpublic List<List<Synset>> getParentPaths()
Synset to the root
of the IS-A hierarchy. Since every Synset can have multiple
parents, there may be multiple paths that have several commond Synsets. The parent paths will begin a the Synset that is
furthest from this Synset and end with this Synset.
getParentPaths in interface Synsetpublic Set<Synset> getParents()
Synsets that are generalized concepts of this Synset. This is equivalent to calling getRelations() with
Relation:HYPERNYM.
getParents in interface Synsetpublic Set<Synset> getChildren()
Synsets that are more specific concepts of this
Synset. This is equivalent to calling getRelations()
with Relation:HYPONYM.
getChildren in interface Synsetpublic int getId()
Synsets that are added
to the dictionary during runtime may return an id of 0. Note that this
value is only needed for corpus readers.
getId in interface Synsetpublic int[] getFrameIds()
getFrameIds in interface Synsetpublic int[] getLemmaIds()
getLemmaIds in interface Synset
public void setFrameInfo(int[] frameIds,
int[] lemmaIds)
setFrameInfo in interface Synsetpublic void setId(int newOffset)
Synset. Only corpus readers need to set
this value.
setId in interface Synsetpublic void setDefinition(String definition)
Synset.
setDefinition in interface Synsetpublic void addLemma(Lemma lemma)
Lemma to this Synset. Lemmas may be
added in order according to their precedence for the Synset.
addLemma in interface Synsetpublic void addExample(String example)
Synset are used in everday speech.
addExample in interface Synset
public void addDerivationallyRelatedForm(Synset related,
RelatedForm form)
RelatedForm to this Synset, signifiying that the
two Synsets share a Lemma that are closely related.
addDerivationallyRelatedForm in interface Synset
public boolean addRelation(Synset.Relation relation,
Synset synset)
true if a new relation is added between this and
related by relation. Returning false signifies
that the relation already exists.
addRelation in interface Synset
public boolean addRelation(String relation,
Synset synset)
true if a new relation is added between this and
related by relation. Returning false signifies
that the relation already exists.
addRelation in interface Synset
public boolean removeRelation(Synset.Relation relation,
Synset synset)
true if a relation between this and related by the link relation was removed. Returning false signifies that there was no link to remove.
removeRelation in interface Synset
public boolean removeRelation(String relation,
Synset synset)
true if a relation between this and related by the link relation was removed. Returning false signifies that there was no link to remove.
removeRelation in interface Synsetpublic String getGloss()
getGloss in interface Synsetpublic int getMaxDepth()
Synset and the root
Synset.
getMaxDepth in interface Synsetpublic int getMinDepth()
Synset and the root
Synset.
getMinDepth in interface Synset
public void setAttribute(String attributeName,
Attribute attribute)
attribute as an object that described this Synset
with more detail. attributeName is a label for the provided
attribute.
setAttribute in interface Synsetpublic Attribute getAttribute(String attributeName)
Attribute associated with the label attributeName applied to this Synset, or null if there
is no associated attribute.
getAttribute in interface Synsetpublic Set<String> attributeLabels()
Attribute keys currently held by this Synset.
attributeLabels in interface Synsetpublic void merge(Synset synset)
Synset with the provided Synset.
merge in interface Synsetpublic String toString()
Synsets name and gloss.
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||