public class WiktionaryCollection extends AbstractWiktionary implements IWiktionaryCollection
IWiktionaryCollection interface. The
implementation can be initialized with multiple IWiktionaryEditions
in order to access parsed Wiktionary information of multiple language
editions.| Modifier and Type | Field and Description |
|---|---|
protected List<IWiktionaryEdition> |
editions |
| Constructor and Description |
|---|
WiktionaryCollection()
Initializes the Wiktionary collection.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addEdition(IWiktionaryEdition edition)
Add the specified Wiktionary language edition to the current
collection.
|
void |
close()
Disconnects from the database.
|
IWiktionaryIterator<IWiktionaryEntry> |
getAllEntries(IWiktionaryEntryFilter filter,
boolean sortByTitle,
boolean normalize)
Returns an iterator over all
IWiktionaryEntrys within
the Wiktionary edition. |
IWiktionaryIterator<IWiktionaryPage> |
getAllPages(IWiktionaryPageFilter filter,
boolean sortByTitle,
boolean normalize)
Returns an iterator over all
IWiktionaryPages within
the Wiktionary edition. |
IWiktionaryIterator<IWiktionarySense> |
getAllSenses(IWiktionarySenseFilter filter,
boolean sortByTitle,
boolean normalize)
Returns an iterator over all
IWiktionaryEntrys within
the Wiktionary edition. |
Iterable<IWiktionaryEdition> |
getEditions()
Returns a list of all Wiktionary langauge editions in
this collection.
|
List<IWiktionaryEntry> |
getEntriesForWord(String word,
IWiktionaryEntryFilter filter,
boolean normalize)
Returns a list of
IWiktionaryEntrys encoded on a page with
the given title. |
IWiktionaryPage |
getPageForId(long id,
ILanguage entryLanguage)
Returns the page of the specified Wiktionary language edition with
the given unique id.
|
List<IWiktionaryPage> |
getPagesForId(long id)
Returns the pages with the given (edition-specific) unique id.
|
List<IWiktionaryPage> |
getPagesForWord(String word)
Returns all pages with the given title.
|
List<IWiktionaryPage> |
getPagesForWord(String word,
IWiktionaryPageFilter filter)
Returns all pages with the given title.
|
List<IWiktionaryPage> |
getPagesForWord(String word,
IWiktionaryPageFilter filter,
boolean normalize)
Returns the page with the given title.
|
IWiktionarySense |
getSenseForKey(String key,
ILanguage language)
Returns the word sense with the given (edition-specific) unique id.
|
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
true if the database connection has already been
closed using the IWiktionary.close() method. |
void |
removeEdition(IWiktionaryEdition edition)
Removes the specified edition from the collection.
|
getAllEntries, getAllEntries, getAllEntries, getAllEntries, getAllEntries, getAllPages, getAllPages, getAllPages, getAllPages, getAllPages, getAllSenses, getAllSenses, getAllSenses, getAllSenses, getAllSenses, getEntriesForWord, getEntriesForWord, getEntriesForWord, getPagesForWord, getSensesForWord, getSensesForWord, getSensesForWordclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetAllEntries, getAllEntries, getAllEntries, getAllEntries, getAllEntries, getAllPages, getAllPages, getAllPages, getAllPages, getAllPages, getAllSenses, getAllSenses, getAllSenses, getAllSenses, getAllSenses, getEntriesForWord, getEntriesForWord, getEntriesForWord, getPagesForWord, getSensesForWord, getSensesForWord, getSensesForWordprotected List<IWiktionaryEdition> editions
public WiktionaryCollection()
public void addEdition(IWiktionaryEdition edition)
IWiktionaryCollectionaddEdition in interface IWiktionaryCollectionpublic Iterable<IWiktionaryEdition> getEditions()
IWiktionaryCollectiongetEditions in interface IWiktionaryCollectionpublic void removeEdition(IWiktionaryEdition edition)
IWiktionaryCollectionIWiktionary.close() method.removeEdition in interface IWiktionaryCollectionpublic List<IWiktionaryPage> getPagesForId(long id)
IWiktionaryCollectiongetPagesForId in interface IWiktionaryCollectionpublic IWiktionaryPage getPageForId(long id, ILanguage entryLanguage)
IWiktionaryCollectiongetPageForId in interface IWiktionaryCollectionpublic List<IWiktionaryPage> getPagesForWord(String word)
IWiktionaryCollectionIWiktionary.getPagesForWord(String, boolean) for case insensitive and
string-normalized matching.getPagesForWord in interface IWiktionaryCollectionpublic List<IWiktionaryPage> getPagesForWord(String word, IWiktionaryPageFilter filter)
IWiktionaryCollectionIWiktionary.getPagesForWord(String, boolean) for case insensitive and
string-normalized matching. Using the given
IWiktionaryPageFilter, unwanted pages can be ignored.getPagesForWord in interface IWiktionaryCollectionpublic List<IWiktionaryPage> getPagesForWord(String word, IWiktionaryPageFilter filter, boolean normalize)
IWiktionaryIWiktionaryPageFilter, unwanted pages can be ignored.getPagesForWord in interface IWiktionarygetPagesForWord in class AbstractWiktionarypublic IWiktionaryIterator<IWiktionaryPage> getAllPages(IWiktionaryPageFilter filter, boolean sortByTitle, boolean normalize)
IWiktionaryIWiktionaryPages within
the Wiktionary edition. Using the given IWiktionaryPageFilter,
unwanted pages can be ignored.getAllPages in interface IWiktionarygetAllPages 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 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 getSenseForKey(String key, ILanguage language)
IWiktionaryCollectiongetSenseForKey in interface IWiktionaryCollectionpublic 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()
IWiktionaryclose in interface IWiktionaryclose in interface Closeableclose in interface AutoCloseablepublic boolean isClosed()
IWiktionarytrue if the database connection has already been
closed using the IWiktionary.close() method.isClosed in interface IWiktionaryCopyright © 2011-2016 Ubiquitous Knowledge Processing (UKP) Lab. All Rights Reserved.