public abstract class WiktionaryEdition extends AbstractWiktionary implements IWiktionaryEdition
IWiktionaryEdition
s.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
IWiktionaryEntry s within
the Wiktionary edition. |
IWiktionaryIterator<IWiktionarySense> |
getAllSenses(IWiktionarySenseFilter filter,
boolean sortByTitle,
boolean normalize)
Returns an iterator over all
IWiktionaryEntry s within
the Wiktionary edition. |
List<IWiktionaryEntry> |
getEntriesForWord(String word,
IWiktionaryEntryFilter filter,
boolean normalize)
Returns a list of
IWiktionaryEntry s 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
IWiktionarySense s 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
IWiktionarySense s 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, getSensesForWord
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getDBPath, getEntryForId, getLanguage, getPageForId, getPageForWord, getSenseForKey
getAllEntries, getAllEntries, getAllEntries, getAllEntries, getAllEntries, getAllPages, getAllPages, getAllPages, getAllPages, getAllPages, getAllPages, getAllSenses, getAllSenses, getAllSenses, getAllSenses, getAllSenses, getEntriesForWord, getEntriesForWord, getEntriesForWord, getPagesForWord, getPagesForWord, getSensesForWord, getSensesForWord, getSensesForWord
public IWiktionaryEntry getEntryForId(long pageId, int entryIdx)
IWiktionaryEdition
IWiktionaryEntry
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 IWiktionaryEdition
public IWiktionaryEntry getEntryForWord(String word, int entryIdx)
IWiktionaryEdition
IWiktionaryEntry
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 IWiktionaryEdition
public List<IWiktionaryEntry> getEntriesForWord(String word, IWiktionaryEntryFilter filter, boolean normalize)
IWiktionary
IWiktionaryEntry
s encoded on a page with
the given title. Using the given IWiktionaryEntryFilter
,
unwanted entries can be ignored.getEntriesForWord
in interface IWiktionary
getEntriesForWord
in class AbstractWiktionary
normalize
- if true
, match the page title in a
case insensitive manner.public IWiktionaryIterator<IWiktionaryEntry> getAllEntries(IWiktionaryEntryFilter filter, boolean sortByTitle, boolean normalize)
IWiktionary
IWiktionaryEntry
s 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 IWiktionary
getAllEntries
in class AbstractWiktionary
sortByTitle
- 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)
IWiktionaryEdition
getSenseForId
in interface IWiktionaryEdition
public IWiktionarySense getSenseForId(long pageId, int entryIdx, int senseIdx)
IWiktionaryEdition
getSenseForId
in interface IWiktionaryEdition
public List<IWiktionarySense> getSensesForWord(String word, int entryIdx)
IWiktionaryEdition
IWiktionarySense
s 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 IWiktionaryEdition
public IWiktionarySense getSensesForWord(String word, int entryIdx, int senseIdx)
IWiktionaryEdition
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. The method only returns the
sense if the page title matches exactly.getSensesForWord
in interface IWiktionaryEdition
public List<IWiktionarySense> getSensesForWord(String word, IWiktionarySenseFilter filter, boolean normalize)
IWiktionary
IWiktionarySense
s encoded on a page with
the given title. Using the given IWiktionarySenseFilter
,
unwanted word senses can be ignored.getSensesForWord
in interface IWiktionary
getSensesForWord
in class AbstractWiktionary
normalize
- if true
, match the page title in a
case insensitive manner.public IWiktionaryIterator<IWiktionarySense> getAllSenses(IWiktionarySenseFilter filter, boolean sortByTitle, boolean normalize)
IWiktionary
IWiktionaryEntry
s 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 IWiktionary
getAllSenses
in class AbstractWiktionary
sortByTitle
- 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 IWiktionary
close
in interface Closeable
close
in interface AutoCloseable
public boolean isClosed()
close()
method.isClosed
in interface IWiktionary
protected 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.