public abstract class WiktionaryEdition extends AbstractWiktionary implements IWiktionaryEdition
IWiktionaryEditions.| Modifier and Type | Field and Description |
|---|---|
protected boolean |
isClosed |
| Constructor and Description |
|---|
WiktionaryEdition()
Initializes the Wiktionary edition.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Disconnects from the database.
|
protected abstract void |
doClose() |
protected void |
ensureOpen() |
IWiktionaryIterator<IWiktionaryEntry> |
getAllEntries(IWiktionaryEntryFilter filter,
boolean sortByTitle,
boolean normalize)
Returns an iterator over all
IWiktionaryEntrys within
the Wiktionary edition. |
IWiktionaryIterator<IWiktionarySense> |
getAllSenses(IWiktionarySenseFilter filter,
boolean sortByTitle,
boolean normalize)
Returns an iterator over all
IWiktionaryEntrys within
the Wiktionary edition. |
List<IWiktionaryEntry> |
getEntriesForWord(String word,
IWiktionaryEntryFilter filter,
boolean normalize)
Returns a list of
IWiktionaryEntrys encoded on a page with
the given title. |
IWiktionaryEntry |
getEntryForId(long pageId,
int entryIdx)
Returns the
IWiktionaryEntry with the given page id and
entry index. |
IWiktionaryEntry |
getEntryForWord(String word,
int entryIdx)
Returns the
IWiktionaryEntry encoded on a page with
the given title and being part of an entry with the specified entry
index. |
IWiktionarySense |
getSenseForId(long entryId,
int senseIdx)
Returns the word sense with the given entry id and sense index.
|
IWiktionarySense |
getSenseForId(long pageId,
int entryIdx,
int senseIdx)
Returns the word sense with the given page id, entry index, and sense
index.
|
List<IWiktionarySense> |
getSensesForWord(String word,
int entryIdx)
Returns a list of
IWiktionarySenses encoded on a page with
the given title and being part of an entry with the specified entry
index. |
IWiktionarySense |
getSensesForWord(String word,
int entryIdx,
int senseIdx)
Returns the
IWiktionarySense encoded on the page with
the given title and being part of the entry with the specified entry
index at the specified sense index. |
List<IWiktionarySense> |
getSensesForWord(String word,
IWiktionarySenseFilter filter,
boolean normalize)
Returns a list of
IWiktionarySenses encoded on a page with
the given title. |
boolean |
isClosed()
Returns if the connection has already been closed.
|
getAllEntries, getAllEntries, getAllEntries, getAllEntries, getAllEntries, getAllPages, getAllPages, getAllPages, getAllPages, getAllPages, getAllPages, getAllSenses, getAllSenses, getAllSenses, getAllSenses, getAllSenses, getEntriesForWord, getEntriesForWord, getEntriesForWord, getPagesForWord, getPagesForWord, getSensesForWord, getSensesForWord, getSensesForWordclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetDBPath, getEntryForId, getLanguage, getPageForId, getPageForWord, getSenseForKeygetAllEntries, getAllEntries, getAllEntries, getAllEntries, getAllEntries, getAllPages, getAllPages, getAllPages, getAllPages, getAllPages, getAllPages, getAllSenses, getAllSenses, getAllSenses, getAllSenses, getAllSenses, getEntriesForWord, getEntriesForWord, getEntriesForWord, getPagesForWord, getPagesForWord, getSensesForWord, getSensesForWord, getSensesForWordpublic IWiktionaryEntry getEntryForId(long pageId, int entryIdx)
IWiktionaryEditionIWiktionaryEntry with the given page id and
entry index. Note that this id combination is only stable over the
same XML dump and JWKTL version.getEntryForId in interface IWiktionaryEditionpublic IWiktionaryEntry getEntryForWord(String word, int entryIdx)
IWiktionaryEditionIWiktionaryEntry encoded on a page with
the given title and being part of an entry with the specified entry
index. The method only returns the entries if the page title
matches exactly.getEntryForWord in interface IWiktionaryEditionpublic List<IWiktionaryEntry> getEntriesForWord(String word, IWiktionaryEntryFilter filter, boolean normalize)
IWiktionaryIWiktionaryEntrys encoded on a page with
the given title. Using the given IWiktionaryEntryFilter,
unwanted entries can be ignored.getEntriesForWord in interface IWiktionarygetEntriesForWord in class AbstractWiktionarynormalize - if true, match the page title in a
case insensitive manner.public IWiktionaryIterator<IWiktionaryEntry> getAllEntries(IWiktionaryEntryFilter filter, boolean sortByTitle, boolean normalize)
IWiktionaryIWiktionaryEntrys within
the Wiktionary edition. This is equivalent to iterating over all
pages using IWiktionary.getAllPages(boolean, boolean)
and then over the page's entries using
IWiktionaryPage.getEntries().
The pages are sorted according to the method's parameters; the
entries are sorted by their index. Using the given
IWiktionaryEntryFilter, unwanted entries can be ignored.getAllEntries in interface IWiktionarygetAllEntries in class AbstractWiktionarysortByTitle - if true sort by page title;
otherwise by page id.normalize - if true sort case insensitive;
otherwise case sensitive (only affects sorting by title).public IWiktionarySense getSenseForId(long entryId, int senseIdx)
IWiktionaryEditiongetSenseForId in interface IWiktionaryEditionpublic IWiktionarySense getSenseForId(long pageId, int entryIdx, int senseIdx)
IWiktionaryEditiongetSenseForId in interface IWiktionaryEditionpublic List<IWiktionarySense> getSensesForWord(String word, int entryIdx)
IWiktionaryEditionIWiktionarySenses encoded on a page with
the given title and being part of an entry with the specified entry
index. The method only returns the senses if the page title
matches exactly.getSensesForWord in interface IWiktionaryEditionpublic IWiktionarySense getSensesForWord(String word, int entryIdx, int senseIdx)
IWiktionaryEditionIWiktionarySense encoded on the page with
the given title and being part of the entry with the specified entry
index at the specified sense index. The method only returns the
sense if the page title matches exactly.getSensesForWord in interface IWiktionaryEditionpublic List<IWiktionarySense> getSensesForWord(String word, IWiktionarySenseFilter filter, boolean normalize)
IWiktionaryIWiktionarySenses encoded on a page with
the given title. Using the given IWiktionarySenseFilter,
unwanted word senses can be ignored.getSensesForWord in interface IWiktionarygetSensesForWord in class AbstractWiktionarynormalize - if true, match the page title in a
case insensitive manner.public IWiktionaryIterator<IWiktionarySense> getAllSenses(IWiktionarySenseFilter filter, boolean sortByTitle, boolean normalize)
IWiktionaryIWiktionaryEntrys within
the Wiktionary edition. This is equivalent to iterating over all
pages using IWiktionary.getAllPages(boolean, boolean)
and then over the page's entries using
IWiktionaryPage.getEntries() and then over the entry's
senses using IWiktionaryEntry.getSenses().
The pages are sorted according to the method's parameters; the
entries and senses are sorted by their index. Using the given
IWiktionarySenseFilter, unwanted word senses can be ignored.getAllSenses in interface IWiktionarygetAllSenses in class AbstractWiktionarysortByTitle - if true sort by page title;
otherwise by page id.normalize - if true sort case insensitive;
otherwise case sensitive (only affects sorting by title).public void close()
close in interface IWiktionaryclose in interface Closeableclose in interface AutoCloseablepublic boolean isClosed()
close() method.isClosed in interface IWiktionaryprotected abstract void doClose()
protected void ensureOpen()
IllegalStateException - if the connection has already been
closed. This method is to be called from each retrieval method.Copyright © 2011-2016 Ubiquitous Knowledge Processing (UKP) Lab. All Rights Reserved.