@Persistent public class WiktionarySense extends Object implements IWiktionarySense
IWiktionarySense
interface.
See there for details.Modifier and Type | Field and Description |
---|---|
protected WiktionaryEntry |
entry |
protected long |
entryId |
protected List<IWiktionaryExample> |
examples |
protected IWikiString |
gloss |
protected int |
index |
protected String |
marker |
protected List<IQuotation> |
quotations |
protected List<IWikiString> |
references |
protected List<IWiktionaryRelation> |
relations |
protected List<IWiktionaryTranslation> |
translations |
Constructor and Description |
---|
WiktionarySense() |
Modifier and Type | Method and Description |
---|---|
void |
addExample(IWiktionaryExample example)
Add the given example to this sense.
|
void |
addQuotation(IQuotation quotation)
Add the given quotation to this sense.
|
void |
addReference(IWikiString reference)
Add the given reference to this sense.
|
void |
addRelation(IWiktionaryRelation relation)
Add the given relation to this sense.
|
void |
addTranslation(IWiktionaryTranslation translation)
Add the given translation to this sense.
|
IWiktionaryEntry |
getEntry()
Returns a reference to the
IWiktionaryEntry that contains
this sense. |
long |
getEntryId()
Shorthand for
getEntry().getId() . |
List<IWiktionaryExample> |
getExamples()
Returns a list of sense examples or
null if no sense
examples are encoded. |
IWikiString |
getGloss()
Returns the sense description as a
IWikiString . |
String |
getId()
Returns an ID of this sense that is unique for all senses
of the containing
IWiktionaryEntry . |
int |
getIndex()
Returns the index of this sense.
|
String |
getKey()
Returns a unique ID for this word sense.
|
String |
getMarker()
Returns the marker for this sense as defined in Wiktionary.
|
IWiktionaryPage |
getPage()
Returns a reference to the
IWiktionaryPage that contains
this sense. |
List<IQuotation> |
getQuotations()
Returns a list of quotations or
null if no
quotations are encoded. |
List<IWikiString> |
getReferences()
Returns a list of references for this sense or
null if no referemces are encoded. |
List<IWiktionaryRelation> |
getRelations()
Returns the list of all sense relations (or
null
if no relations are encoded). |
List<IWiktionaryRelation> |
getRelations(RelationType relationType)
Returns the list of sense relations of the given relation type.
|
List<IWiktionaryTranslation> |
getTranslations()
Returns the list of all translations (or
null
if no translations are encoded). |
List<IWiktionaryTranslation> |
getTranslations(ILanguage language)
Returns the list of translations into the given language.
|
void |
init(WiktionaryEntry entry)
Initialize the sense using the given Wiktionary entry.
|
void |
setGloss(IWikiString gloss)
Add the given sense definition to this sense.
|
protected void |
setIndex(int index)
Assigns the given index to this sense.
|
void |
setMarker(String marker)
Assigns the given sense marker to this sense.
|
String |
toString() |
protected int index
protected String marker
protected transient WiktionaryEntry entry
protected long entryId
protected IWikiString gloss
protected List<IWiktionaryExample> examples
protected List<IQuotation> quotations
protected List<IWikiString> references
protected List<IWiktionaryRelation> relations
protected List<IWiktionaryTranslation> translations
public void init(WiktionaryEntry entry)
public String getKey()
IWiktionarySense
IWiktionarySense
s of the IWiktionaryEdition
. Note
however that the ID of a sense may differ between different software
versions or dump dates.getKey
in interface IWiktionarySense
public String getId()
IWiktionarySense
IWiktionaryEntry
. Use IWiktionarySense.getKey()
for a globally unique identifier.getId
in interface IWiktionarySense
public long getEntryId()
getEntry().getId()
.public int getIndex()
IWiktionarySense
IWiktionaryEntry
. The first sense has index 1.
Note that this is not generally the index marker used in Wiktionary:
the first sense has for example always index 1, although it might
be marked with "[2]" or "[1a]". See IWiktionarySense.getMarker()
for details.getIndex
in interface IWiktionarySense
protected void setIndex(int index)
public String getMarker()
IWiktionarySense
getMarker
in interface IWiktionarySense
public void setMarker(String marker)
public IWiktionaryEntry getEntry()
IWiktionarySense
IWiktionaryEntry
that contains
this sense.getEntry
in interface IWiktionarySense
public IWiktionaryPage getPage()
IWiktionarySense
IWiktionaryPage
that contains
this sense.getPage
in interface IWiktionarySense
public IWikiString getGloss()
IWiktionarySense
IWikiString
.getGloss
in interface IWiktionarySense
public void setGloss(IWikiString gloss)
public void addExample(IWiktionaryExample example)
public List<IWiktionaryExample> getExamples()
IWiktionarySense
null
if no sense
examples are encoded.getExamples
in interface IWiktionarySense
public void addQuotation(IQuotation quotation)
public List<IQuotation> getQuotations()
IWiktionarySense
null
if no
quotations are encoded.getQuotations
in interface IWiktionarySense
public void addReference(IWikiString reference)
public List<IWikiString> getReferences()
IWiktionarySense
null
if no referemces are encoded.getReferences
in interface IWiktionarySense
public void addRelation(IWiktionaryRelation relation)
public List<IWiktionaryRelation> getRelations()
IWiktionarySense
null
if no relations are encoded).getRelations
in interface IWiktionarySense
public List<IWiktionaryRelation> getRelations(RelationType relationType)
IWiktionarySense
getRelations
in interface IWiktionarySense
public void addTranslation(IWiktionaryTranslation translation)
public List<IWiktionaryTranslation> getTranslations(ILanguage language)
IWiktionarySense
getTranslations
in interface IWiktionarySense
public List<IWiktionaryTranslation> getTranslations()
IWiktionarySense
null
if no translations are encoded).getTranslations
in interface IWiktionarySense
Copyright © 2011-2016 Ubiquitous Knowledge Processing (UKP) Lab. All Rights Reserved.