@Persistent public class WiktionaryEntry extends Object implements IWiktionaryEntry
IWiktionaryEntry
interface.
See there for details.Modifier and Type | Field and Description |
---|---|
protected String |
entryLink |
protected String |
entryLinkType |
protected IWikiString |
etymology |
protected List<GrammaticalGender> |
genders |
protected String |
header |
protected long |
id |
protected int |
index |
protected IWiktionaryPage |
page |
protected long |
pageId |
protected List<PartOfSpeech> |
partsOfSpeech |
protected List<IPronunciation> |
pronunciations |
protected List<WiktionarySense> |
senses |
protected IWikiString |
usageNotes |
protected List<IWiktionaryWordForm> |
wordForms |
protected ILanguage |
wordLanguage |
protected String |
wordLanguageStr |
Constructor and Description |
---|
WiktionaryEntry()
Instanciates a new, empty entry.
|
Modifier and Type | Method and Description |
---|---|
void |
addGender(GrammaticalGender gender)
Adds the given grammatical gender to the list of genders.
|
void |
addPartOfSpeech(PartOfSpeech partOfSpeech)
Adds the given part of speech to the list of part of speech tags.
|
void |
addPronunciation(IPronunciation pronunciation)
Adds the given pronunciation.
|
void |
addSense(WiktionarySense sense)
Add the given sense to the list of senses.
|
void |
addWordForm(IWiktionaryWordForm wordForm)
Adds the given word form.
|
WiktionarySense |
createSense()
Factory method for creating a new word sense.
|
WiktionarySense |
findSenseByMarker(String marker)
Identify the first sense of this entry with the given marker.
|
String |
getEntryLink()
Some lexical entries refer to other pages rather than encoding
all information on the entry again.
|
String |
getEntryLinkType()
Returns the type of the
IWiktionaryEntry.getEntryLink() , for example, denoting
that the entry is an old spelling variant of the linked entry. |
List<IWiktionaryExample> |
getExamples()
Returns a list containing all sense definitions of the entry's senses
/** Returns a list containing all examples of the entry's senses
(including the unassigned sense).
|
GrammaticalGender |
getGender()
Returns the grammatical gender of this lexical entry, which can
be one of masculine, feminine, neuter.
|
List<GrammaticalGender> |
getGenders()
Returns the grammatical genders of this lexical entry.
|
List<IWikiString> |
getGlosses()
Returns a list containing all sense definitions of the entry's senses
(including the unassigned sense).
|
String |
getHeader()
Returns the header of the lexical entry.
|
long |
getId()
Returns an ID of this entry that is unique for all entries
of the containing
IWiktionaryPage . |
int |
getIndex()
Returns the index of this entry.
|
String |
getKey()
Returns a unique ID for this lexical entry.
|
IWiktionaryPage |
getPage()
Returns a reference to the
IWiktionaryPage that contains
this entry. |
long |
getPageId()
Returns the ID of the
IWiktionaryPage that contains
this entry. |
PartOfSpeech |
getPartOfSpeech()
Returns the first part of speech tag encoded for this lexical entry.
|
List<PartOfSpeech> |
getPartsOfSpeech()
Returns all part of speech tags encoded for this lexical entry.
|
List<IPronunciation> |
getPronunciations()
Returns a list of pronunciations for this lexical entry.
|
List<IQuotation> |
getQuotations()
Returns a list containing all quotations of the entry's senses
(including the unassigned sense).
|
List<IWikiString> |
getReferences()
Returns a list containing all references of the entry's senses
(including the unassigned sense).
|
List<IWiktionaryRelation> |
getRelations()
Returns a list containing all semantic relations of the entry's senses
(including the unassigned sense).
|
List<IWiktionaryRelation> |
getRelations(RelationType relationType)
Returns a list containing all semantic relations of the entry's senses
(including the unassigned sense) of the given type.
|
WiktionarySense |
getSense(int index)
Returns the
IWiktionarySense with the given index. |
int |
getSenseCount()
Returns the number of
IWiktionarySense s encoded for this
lexical entry. |
List<? extends IWiktionarySense> |
getSenses()
Returns the list of all
IWiktionarySense s. |
List<? extends IWiktionarySense> |
getSenses(boolean includeUnassignedSense)
Returns the list of all
IWiktionarySense s. |
List<IWiktionaryTranslation> |
getTranslations()
Returns a list containing all translations of the entry's senses
(including the unassigned sense).
|
List<IWiktionaryTranslation> |
getTranslations(ILanguage language)
Returns a list containing all translations of the entry's senses
(including the unassigned sense) to the given language.
|
WiktionarySense |
getUnassignedSense()
Returns a dummy
IWiktionarySense that contains all
information that has not been assigned to a particular sense. |
IWikiString |
getUsageNotes()
Returns the usage notes of this lexical entry as a
IWikiString . |
String |
getWord()
Returns the lemma of this lexical entry denoted by the page title.
|
IWikiString |
getWordEtymology()
Returns the etymology of this lexical entry as a
IWikiString . |
List<IWiktionaryWordForm> |
getWordForms()
Returns a list of word forms for this lexical entry.
|
ILanguage |
getWordLanguage()
Returns the language of this lexical entry.
|
void |
init(WiktionaryPage page)
Initialize the entry using the given Wiktionary page.
|
List<WiktionarySense> |
senses()
Internal interface that is used by the parsers.
|
void |
setEntryLink(String entryLink,
String entryLinkType)
Assigns the given entry link.
|
void |
setHeader(String header)
Assigns the given header text (i.e., the first headline of the entry,
which normally correponds to a word's lemma).
|
void |
setId(long id)
Assign the specified entry ID.
|
void |
setUsageNotes(IWikiString usageNotes) |
void |
setWordEtymology(IWikiString etymology)
Assigns the given etymology text.
|
void |
setWordLanguage(ILanguage wordLanguage)
Assigns the given word language.
|
String |
toString() |
protected long id
protected int index
protected transient IWiktionaryPage page
protected long pageId
protected String header
protected String wordLanguageStr
protected transient ILanguage wordLanguage
protected List<PartOfSpeech> partsOfSpeech
protected List<GrammaticalGender> genders
protected IWikiString etymology
protected IWikiString usageNotes
protected String entryLink
protected String entryLinkType
protected List<IPronunciation> pronunciations
protected List<IWiktionaryWordForm> wordForms
protected List<WiktionarySense> senses
public void init(WiktionaryPage page)
public WiktionarySense createSense()
public String getKey()
IWiktionaryEntry
IWiktionaryEntry
s of the IWiktionaryEdition
. Note
however that the ID of an entry may differ between different software
versions or dump dates.getKey
in interface IWiktionaryEntry
public long getId()
IWiktionaryEntry
IWiktionaryPage
. Depending on the parsing
mode, the ID may be a running number of entries or a sense index.
Use IWiktionaryEntry.getKey()
for a globally unique identifier. Note
however that the ID of an entry may differ between different software
versions or dump dates.
IMPORTANT: The entry ID is unstable w.r.t. to different API
versions and dump files. Better rely on page IDs and eventually
local indices.getId
in interface IWiktionaryEntry
public void setId(long id)
public int getIndex()
IWiktionaryEntry
IWiktionaryPage
(starting at 0).getIndex
in interface IWiktionaryEntry
public IWiktionaryPage getPage()
IWiktionaryEntry
IWiktionaryPage
that contains
this entry.getPage
in interface IWiktionaryEntry
public long getPageId()
IWiktionaryEntry
IWiktionaryPage
that contains
this entry.getPageId
in interface IWiktionaryEntry
public String getWord()
IWiktionaryEntry
getPage().getTitle()
.getWord
in interface IWiktionaryEntry
public String getHeader()
IWiktionaryEntry
IWiktionaryEntry.getWord()
, but there are
some exceptions where the Wiktionary community uses a slightly
different header.getHeader
in interface IWiktionaryEntry
public void setHeader(String header)
public ILanguage getWordLanguage()
IWiktionaryEntry
IWiktionaryEdition
; e.g.,
for French entries within the English Wiktionary edition.getWordLanguage
in interface IWiktionaryEntry
public void setWordLanguage(ILanguage wordLanguage)
public PartOfSpeech getPartOfSpeech()
IWiktionaryEntry
null
will be returned.getPartOfSpeech
in interface IWiktionaryEntry
public List<PartOfSpeech> getPartsOfSpeech()
IWiktionaryEntry
getPartsOfSpeech
in interface IWiktionaryEntry
public void addPartOfSpeech(PartOfSpeech partOfSpeech)
public GrammaticalGender getGender()
IWiktionaryEntry
IWiktionaryEntry.getGenders()
to access
genders.getGender
in interface IWiktionaryEntry
public List<GrammaticalGender> getGenders()
IWiktionaryEntry
getGenders
in interface IWiktionaryEntry
public void addGender(GrammaticalGender gender)
public IWikiString getWordEtymology()
IWiktionaryEntry
IWikiString
.
The result might be null
if no etymology has been
encoded.getWordEtymology
in interface IWiktionaryEntry
public void setWordEtymology(IWikiString etymology)
public String getEntryLink()
IWiktionaryEntry
IWiktionaryPage.getRedirectTarget()
), but limited to the
entry level. In addition to that, there might be further information
provided.getEntryLink
in interface IWiktionaryEntry
public String getEntryLinkType()
IWiktionaryEntry
IWiktionaryEntry.getEntryLink()
, for example, denoting
that the entry is an old spelling variant of the linked entry.getEntryLinkType
in interface IWiktionaryEntry
public void setEntryLink(String entryLink, String entryLinkType)
public void addPronunciation(IPronunciation pronunciation)
public List<IPronunciation> getPronunciations()
IWiktionaryEntry
null
if not pronunciations are
encoded.getPronunciations
in interface IWiktionaryEntry
public void addWordForm(IWiktionaryWordForm wordForm)
public List<IWiktionaryWordForm> getWordForms()
IWiktionaryEntry
null
if not word forms are
encoded.getWordForms
in interface IWiktionaryEntry
public void addSense(WiktionarySense sense)
public WiktionarySense getUnassignedSense()
IWiktionaryEntry
IWiktionarySense
that contains all
information that has not been assigned to a particular sense. This
is usually the case if the sense marker of an information does not
match with any IWiktionarySense.getMarker()
- e.g., containing
question marks. The unassigned sense is never null
.
This method is equivalent to getSense(0)
.getUnassignedSense
in interface IWiktionaryEntry
public WiktionarySense getSense(int index)
IWiktionaryEntry
IWiktionarySense
with the given index.
IMPORTANT: The index is a running number starting at 1. Providing
parameter 0 yields the unassigned sense (equivalent to
IWiktionaryEntry.getUnassignedSense()
. The maximum index is equivalent to
IWiktionaryEntry.getSenseCount()
(rather than IWiktionaryEntry.getSenseCount()
- 1).getSense
in interface IWiktionaryEntry
public int getSenseCount()
IWiktionaryEntry
IWiktionarySense
s encoded for this
lexical entry.getSenseCount
in interface IWiktionaryEntry
public List<? extends IWiktionarySense> getSenses()
IWiktionaryEntry
IWiktionarySense
s. The list is
never null nor empty. The elements of the list are all senses of
this entry, i.e. all senses with index 1 to IWiktionaryEntry.getSenseCount()
.
This method is equivalent to IWiktionaryEntry.getSenses(boolean)
with parameter
false
.getSenses
in interface IWiktionaryEntry
public List<? extends IWiktionarySense> getSenses(boolean includeUnassignedSense)
IWiktionaryEntry
IWiktionarySense
s. The list is
never null nor empty. If the parameter is set to true
,
the first element (list index 0) is the unassigned sense (equivalent
to IWiktionaryEntry.getUnassignedSense()
. The following elements are all
senses of this entry, i.e. all senses with index 1 to
IWiktionaryEntry.getSenseCount()
.getSenses
in interface IWiktionaryEntry
public List<WiktionarySense> senses()
public WiktionarySense findSenseByMarker(String marker)
public List<IWikiString> getGlosses()
IWiktionaryEntry
IWiktionarySense.getGloss()
for each sense.
The list is never null
but might be empty.getGlosses
in interface IWiktionaryEntry
public List<IWiktionaryExample> getExamples()
IWiktionaryEntry
IWiktionarySense.getExamples()
for each sense.
The list is never null
but might be empty.getExamples
in interface IWiktionaryEntry
public List<IQuotation> getQuotations()
IWiktionaryEntry
IWiktionarySense.getQuotations()
for each sense.
The list is never null
but might be empty.getQuotations
in interface IWiktionaryEntry
public List<IWiktionaryRelation> getRelations()
IWiktionaryEntry
IWiktionarySense.getRelations()
for each sense.
The list is never null
but might be empty.getRelations
in interface IWiktionaryEntry
public List<IWiktionaryRelation> getRelations(RelationType relationType)
IWiktionaryEntry
IWiktionarySense.getRelations(RelationType)
for each sense.
The list is never null
but might be empty.getRelations
in interface IWiktionaryEntry
public List<IWikiString> getReferences()
IWiktionaryEntry
IWiktionarySense.getReferences()
for each sense.
The list is never null
but might be empty.getReferences
in interface IWiktionaryEntry
public List<IWiktionaryTranslation> getTranslations()
IWiktionaryEntry
IWiktionarySense.getTranslations()
for each sense.
The list is never null
but might be empty.getTranslations
in interface IWiktionaryEntry
public List<IWiktionaryTranslation> getTranslations(ILanguage language)
IWiktionaryEntry
IWiktionarySense.getTranslations(ILanguage)
for each sense.
The list is never null
but might be empty.getTranslations
in interface IWiktionaryEntry
public IWikiString getUsageNotes()
IWiktionaryEntry
IWikiString
.
The result might be null
if no usage notes have been
encoded.getUsageNotes
in interface IWiktionaryEntry
public void setUsageNotes(IWikiString usageNotes)
Copyright © 2011-2016 Ubiquitous Knowledge Processing (UKP) Lab. All Rights Reserved.