|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgov.llnl.ontology.wordnet.UnsupportedOntologyReader
public class UnsupportedOntologyReader
An OntologyReader
that throws UnsupportedOperationException
for every method call. This is used primarily for unit testing the the
OntologyReaderAdaptor
as it lets unit tests define which methods are
expected to be called and which should not be called by a class without too
much effort.
Constructor Summary | |
---|---|
UnsupportedOntologyReader()
|
Method Summary | |
---|---|
void |
addSynset(Synset synset)
Adds synset to the OntologyReader . |
void |
addSynset(Synset synset,
int index)
Adds synset to the OntologyReader . |
Set<Synset> |
allSynsets()
Returns a Set of all Synset s maintained by this OntologyReader . |
Set<Synset> |
allSynsets(Synset.PartsOfSpeech pos)
Returns a Set of all Synset s for the given Synset.PartsOfSpeech maintained by this OntologyReader . |
int |
getMaxDepth(Synset.PartsOfSpeech pos)
Returns the maximum depth of any Synset chain in this OntologyReader . |
Synset |
getSynset(String fullSynsetName)
Returns the Synset specified by the full synset name. |
Synset |
getSynset(String lemma,
Synset.PartsOfSpeech pos,
int senseNum)
Returns the single Synset specified by the given lemma name, part
of speech tag, and sense number. |
Synset[] |
getSynsets(String lemma)
Returns all Synset s that match the given lemma name. |
Synset[] |
getSynsets(String lemma,
Synset.PartsOfSpeech pos)
Returns all Synset s that match the given lemma name and part of
speech. |
Iterator<String> |
morphy(String form)
Returns an Iterator over the possible morphological variations of
the given word form for all Synset.PartsOfSpeech . |
Iterator<String> |
morphy(String form,
Synset.PartsOfSpeech pos)
Returns an Iterator over the possible morphological variations of
the given word form for a given Synset.PartsOfSpeech . |
void |
removeSynset(Synset synset)
Removes synset from the OntologyReader . |
void |
replaceSynset(Synset synset,
Synset replacement)
Removes the Synset from the known hierarchy. |
Set<String> |
wordnetTerms()
Returns a Set of lemmas that serve as keys in this OntologyReader . |
Set<String> |
wordnetTerms(Synset.PartsOfSpeech pos)
Returns a Set of lemmas that the current word net instance is
aware of for a particular Synset.PartsOfSpeech . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface gov.llnl.ontology.wordnet.OntologyReader |
---|
getSynsets |
Constructor Detail |
---|
public UnsupportedOntologyReader()
Method Detail |
---|
public Iterator<String> morphy(String form)
OntologyReader
Iterator
over the possible morphological variations of
the given word form
for all Synset.PartsOfSpeech
. For each part
of speech, if there are any known exceptions for the form, they will be
returned before the part of speech specific replacement rules. For
example, if "geese" is given, "goose" will be returned first.
Afterwords, no other variations would be returned. If "explodes" is
given, the variants would be "explode", "explode", and "explod", based on
the rules specified in MORPHOLOGICAL_SUBSTITUTIONS
.
morphy
in interface OntologyReader
UnsupportedOperationException
public Iterator<String> morphy(String form, Synset.PartsOfSpeech pos)
OntologyReader
Iterator
over the possible morphological variations of
the given word form
for a given Synset.PartsOfSpeech
. If there
are any known exceptions for the form, they will be returned before the
part of speech specific replacement rules. For example, if "geese" is
given, "goose" will be returned first. Afterwords, no other variations
would be returned. If "explodes" is given, the variants would be
"explode", "explode", and "explod", based on the rules specified in
MORPHOLOGICAL_SUBSTITUTIONS
.
morphy
in interface OntologyReader
UnsupportedOperationException
public void removeSynset(Synset synset)
OntologyReader
synset
from the OntologyReader
. A mapping from
each Lemma
linked to by synset
will be removed from
synset
.
removeSynset
in interface OntologyReader
UnsupportedOperationException
public void addSynset(Synset synset)
OntologyReader
synset
to the OntologyReader
. A mapping from each
Lemma
linked to by synset
will be made to synset
.
synset
will be set as the last Synset
for each Lemma
mapping.
addSynset
in interface OntologyReader
UnsupportedOperationException
public void addSynset(Synset synset, int index)
OntologyReader
synset
to the OntologyReader
. A mapping from each
Lemma
linked to by synset
will be made to synset
.
synset
will be set at index index
for each Lemma
mapping, or as the last entry if index
is too large for any
particular Lemma
mapping.
addSynset
in interface OntologyReader
UnsupportedOperationException
public void replaceSynset(Synset synset, Synset replacement)
OntologyReader
Synset
from the known hierarchy. All mappings from
lemmas to this Synset
will be removed, along with any stored
details about this particular Synset
.
replaceSynset
in interface OntologyReader
UnsupportedOperationException
public Set<String> wordnetTerms()
OntologyReader
Set
of lemmas that serve as keys in this OntologyReader
.
wordnetTerms
in interface OntologyReader
UnsupportedOperationException
public Set<String> wordnetTerms(Synset.PartsOfSpeech pos)
OntologyReader
Set
of lemmas that the current word net instance is
aware of for a particular Synset.PartsOfSpeech
.
wordnetTerms
in interface OntologyReader
UnsupportedOperationException
public Set<Synset> allSynsets()
OntologyReader
Set
of all Synset
s maintained by this OntologyReader
.
allSynsets
in interface OntologyReader
UnsupportedOperationException
public Set<Synset> allSynsets(Synset.PartsOfSpeech pos)
OntologyReader
Set
of all Synset
s for the given Synset.PartsOfSpeech
maintained by this OntologyReader
.
allSynsets
in interface OntologyReader
UnsupportedOperationException
public Synset[] getSynsets(String lemma)
OntologyReader
Synset
s that match the given lemma name.
getSynsets
in interface OntologyReader
UnsupportedOperationException
public Synset[] getSynsets(String lemma, Synset.PartsOfSpeech pos)
OntologyReader
Synset
s that match the given lemma name and part of
speech. If there is no known mapping for the given word, the Synset
s for all it's part of speech specific morphological variations
will be returned.
getSynsets
in interface OntologyReader
UnsupportedOperationException
public Synset getSynset(String fullSynsetName)
OntologyReader
Synset
specified by the full synset name. The name
should be of the following format:
lemma.pos.senseNum
getSynset
in interface OntologyReader
UnsupportedOperationException
public Synset getSynset(String lemma, Synset.PartsOfSpeech pos, int senseNum)
OntologyReader
Synset
specified by the given lemma name, part
of speech tag, and sense number. Sense numbers start at 1.
getSynset
in interface OntologyReader
UnsupportedOperationException
public int getMaxDepth(Synset.PartsOfSpeech pos)
OntologyReader
Synset
chain in this OntologyReader
.
getMaxDepth
in interface OntologyReader
UnsupportedOperationException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |