public class WiktionaryCollection extends AbstractWiktionary implements IWiktionaryCollection
IWiktionaryCollection
interface. The
implementation can be initialized with multiple IWiktionaryEdition
s
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
IWiktionaryEntry s within
the Wiktionary edition. |
IWiktionaryIterator<IWiktionaryPage> |
getAllPages(IWiktionaryPageFilter filter,
boolean sortByTitle,
boolean normalize)
Returns an iterator over all
IWiktionaryPage 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. |
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
IWiktionaryEntry s 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
IWiktionarySense s 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, getSensesForWord
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getAllEntries, getAllEntries, getAllEntries, getAllEntries, getAllEntries, getAllPages, getAllPages, getAllPages, getAllPages, getAllPages, getAllSenses, getAllSenses, getAllSenses, getAllSenses, getAllSenses, getEntriesForWord, getEntriesForWord, getEntriesForWord, getPagesForWord, getSensesForWord, getSensesForWord, getSensesForWord
protected List<IWiktionaryEdition> editions
public WiktionaryCollection()
public void addEdition(IWiktionaryEdition edition)
IWiktionaryCollection
addEdition
in interface IWiktionaryCollection
public Iterable<IWiktionaryEdition> getEditions()
IWiktionaryCollection
getEditions
in interface IWiktionaryCollection
public void removeEdition(IWiktionaryEdition edition)
IWiktionaryCollection
IWiktionary.close()
method.removeEdition
in interface IWiktionaryCollection
public List<IWiktionaryPage> getPagesForId(long id)
IWiktionaryCollection
getPagesForId
in interface IWiktionaryCollection
public IWiktionaryPage getPageForId(long id, ILanguage entryLanguage)
IWiktionaryCollection
getPageForId
in interface IWiktionaryCollection
public List<IWiktionaryPage> getPagesForWord(String word)
IWiktionaryCollection
IWiktionary.getPagesForWord(String, boolean)
for case insensitive and
string-normalized matching.getPagesForWord
in interface IWiktionaryCollection
public List<IWiktionaryPage> getPagesForWord(String word, IWiktionaryPageFilter filter)
IWiktionaryCollection
IWiktionary.getPagesForWord(String, boolean)
for case insensitive and
string-normalized matching. Using the given
IWiktionaryPageFilter
, unwanted pages can be ignored.getPagesForWord
in interface IWiktionaryCollection
public List<IWiktionaryPage> getPagesForWord(String word, IWiktionaryPageFilter filter, boolean normalize)
IWiktionary
IWiktionaryPageFilter
, unwanted pages can be ignored.getPagesForWord
in interface IWiktionary
getPagesForWord
in class AbstractWiktionary
public IWiktionaryIterator<IWiktionaryPage> getAllPages(IWiktionaryPageFilter filter, boolean sortByTitle, boolean normalize)
IWiktionary
IWiktionaryPage
s within
the Wiktionary edition. Using the given IWiktionaryPageFilter
,
unwanted pages can be ignored.getAllPages
in interface IWiktionary
getAllPages
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 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 getSenseForKey(String key, ILanguage language)
IWiktionaryCollection
getSenseForKey
in interface IWiktionaryCollection
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()
IWiktionary
close
in interface IWiktionary
close
in interface Closeable
close
in interface AutoCloseable
public boolean isClosed()
IWiktionary
true
if the database connection has already been
closed using the IWiktionary.close()
method.isClosed
in interface IWiktionary
Copyright © 2011-2016 Ubiquitous Knowledge Processing (UKP) Lab. All Rights Reserved.