|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Synset
This interface represents a single instance of a Synonym Set (Synset
for short) from the WordNet dictionary. A Synset
is composed of
several Lemma
s that have a word sense, or meaning, that is the same.
Each Synset
can be connected to other Synset
s through a
Synset.Relation
. Different Synset.PartsOfSpeech
utilize different sets of
relations.
Synset
has several key attributes:
Synset
, it's
Synset.PartsOfSpeech
, and the sense number for the first Lemma
, for
example "cat.n.01"Synset
Synset
Synset
s, which are keyed by a
Synset.Relation
Synset
s. These are called Hypernyms for nouns
and verbs. For all parts of speech, these are accessed using the Synset.Relation.HYPERNYM
relation. Parent Synset
s are more concepts, for
example "building" is a parent concept of "home". Calling getParents
is equivalent to calling getRelations
with Synset.Relation.HYPERNYM
as the relation argument.Synset
s. These are called Hyponyms for nouns
and Troponyms for verbs. For all parts of speech, these are accessed using
the Synset.Relation.HYPONYM
relation. Child Synset
s are more
specific concecpts, for example "cat" is a child concept of "animal".
Calling getChildren
is equivalent to calling getRelations
with Synset.Relation.HYPONYM
as the relation argument.Synset
s are stored in memory and are connected as a graph. Any
traversal operations should not make the assumption that the graph is
acyclic.
Nested Class Summary | |
---|---|
static class |
Synset.PartsOfSpeech
The set of valid parts of speech encoded by the WordNet dictionary. |
static class |
Synset.Relation
The set of relations that can connect any two Synset s. |
Method Summary | |
---|---|
void |
addDerivationallyRelatedForm(Synset related,
RelatedForm form)
Adds a RelatedForm to this Synset , signifiying that the
two Synset s 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 related)
Returns true if a new relation is added between this and
related by relation . |
boolean |
addRelation(Synset.Relation relation,
Synset related)
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 Synset s 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 Synset s 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
Synset s. |
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 Synset s 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 Synset s that are connected to this Synset through the specified relation string. |
Set<Synset> |
getRelations(Synset.Relation relation)
Returns the set of Synset s 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 other)
Merges this Synset with the provided Synset . |
boolean |
removeRelation(String relation,
Synset related)
Returns true if a relation between this and related by the link relation was removed. |
boolean |
removeRelation(Synset.Relation relation,
Synset related)
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 gloss)
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 id)
Sets the id for a given Synset . |
void |
setSenseNumber(int senseNumber)
Sets the sense number for this Synset . |
Method Detail |
---|
int getId()
Synset
s that are added
to the dictionary during runtime may return an id of 0. Note that this
value is only needed for corpus readers.
void setId(int id)
Synset
. Only corpus readers need to set
this value.
void addMorphyMapping(String original, String lemma)
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
.
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
.
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
.
List<String> getSenseKeys()
Synset
.
void addSenseKey(String senseKey)
int getSenseNumber()
Synset
. Sense numbers may be
modified whenever a Synset
is added, removed, or merged.
void setSenseNumber(int senseNumber)
Synset
. Sense numbers may be
modified whenever a Synset
is added, removed, or merged.
List<String> getExamples()
Synset
is used in regular text.
void addExample(String example)
Synset
are used in everday speech.
String getDefinition()
Synset
void setDefinition(String gloss)
Synset
.
String getGloss()
List<Lemma> getLemmas()
Lemmas
that correspond to this Synset
.
void addLemma(Lemma lemma)
Lemma
to this Synset
. Lemma
s may be
added in order according to their precedence for the Synset
.
int[] getFrameIds()
int[] getLemmaIds()
void setFrameInfo(int[] frameIds, int[] lemmaIds)
Synset.PartsOfSpeech getPartOfSpeech()
Synset.PartsOfSpeech
attributed to this Synset
Set<String> getKnownRelationTypes()
Synset
has with other
Synset
s. In general these keys will be string versions of Synset.Relation
s.
Collection<Synset> allRelations()
Synset
s that are connected to this Synset
, regardless of the relation type.
Set<Synset> getRelations(String relation)
Synset
s that are connected to this Synset
through the specified relation
string.
boolean addRelation(Synset.Relation relation, Synset related)
true
if a new relation is added between this
and
related
by relation
. Returning false
signifies
that the relation already exists.
boolean addRelation(String relation, Synset related)
true
if a new relation is added between this
and
related
by relation
. Returning false
signifies
that the relation already exists.
Set<Synset> getRelations(Synset.Relation relation)
Synset
s that are connected to this Synset
through the specified Synset.Relation
.
boolean removeRelation(Synset.Relation relation, Synset related)
true
if a relation between this
and related
by the link relation
was removed. Returning false
signifies that there was no link to remove.
boolean removeRelation(String relation, Synset related)
true
if a relation between this
and related
by the link relation
was removed. Returning false
signifies that there was no link to remove.
int getNumRelations()
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.
void addDerivationallyRelatedForm(Synset related, RelatedForm form)
RelatedForm
to this Synset
, signifiying that the
two Synset
s share a Lemma
that are closely related.
Set<Synset> getParents()
Synset
s that are generalized concepts of this Synset
. This is equivalent to calling getRelations()
with
Relation:HYPERNYM
.
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 Synset
s. The parent paths will begin a the Synset
that is
furthest from this Synset
and end with this Synset
.
Set<Synset> getChildren()
Synset
s that are more specific concepts of this
Synset
. This is equivalent to calling getRelations()
with Relation:HYPONYM
.
int getMaxDepth()
Synset
and the root
Synset
.
int getMinDepth()
Synset
and the root
Synset
.
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
.
Attribute getAttribute(String attributeName)
Attribute
associated with the label attributeName
applied to this Synset
, or null
if there
is no associated attribute.
Set<String> attributeLabels()
Attribute
keys currently held by this Synset
.
void merge(Synset other)
Synset
with the provided Synset
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |