de.tudarmstadt.ukp.jwktl.api
Interface IWiktionaryCollection

All Superinterfaces:
IWiktionary
All Known Implementing Classes:
WiktionaryCollection

public interface IWiktionaryCollection
extends IWiktionary

Models a list of multiple Wiktionary language editions (e.g., the English and the German Wiktionary editions). Using the querying and iteration methods provided by this interface, the information from all attached language editions may be processed at once and their information can be combined.

Author:
Christian M. Meyer

Method Summary
 void addEdition(IWiktionaryEdition edition)
          Add the specified Wiktionary language edition to the current collection.
 Iterable<IWiktionaryEdition> getEditions()
          Returns a list of all Wiktionary langauge editions in this collection.
 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.
 IWiktionarySense getSenseForKey(String key, ILanguage language)
          Returns the word sense with the given (edition-specific) unique id.
 void removeEdition(IWiktionaryEdition edition)
          Removes the specified edition from the collection.
 
Methods inherited from interface de.tudarmstadt.ukp.jwktl.api.IWiktionary
close, getAllEntries, getAllEntries, getAllEntries, getAllEntries, getAllEntries, getAllEntries, getAllPages, getAllPages, getAllPages, getAllPages, getAllPages, getAllPages, getAllSenses, getAllSenses, getAllSenses, getAllSenses, getAllSenses, getAllSenses, getEntriesForWord, getEntriesForWord, getEntriesForWord, getEntriesForWord, getPagesForWord, getPagesForWord, getSensesForWord, getSensesForWord, getSensesForWord, getSensesForWord, isClosed
 

Method Detail

addEdition

void addEdition(IWiktionaryEdition edition)
Add the specified Wiktionary language edition to the current collection. Querying the collection will then aggregate information from all added editions.


getEditions

Iterable<IWiktionaryEdition> getEditions()
Returns a list of all Wiktionary langauge editions in this collection.


removeEdition

void removeEdition(IWiktionaryEdition edition)
Removes the specified edition from the collection. Note that the removed edition is still open. If you do not need it anymore, call additionally the IWiktionary.close() method.


getPagesForId

List<IWiktionaryPage> getPagesForId(long id)
Returns the pages with the given (edition-specific) unique id.

Throws:
IllegalStateException - if the connection has already been closed.
WiktionaryException - upon database errors.

getPageForId

IWiktionaryPage getPageForId(long id,
                             ILanguage entryLanguage)
Returns the page of the specified Wiktionary language edition with the given unique id.

Throws:
IllegalStateException - if the connection has already been closed.
WiktionaryException - upon database errors.

getPagesForWord

List<IWiktionaryPage> getPagesForWord(String word)
Returns all pages with the given title. The method only returns the page if its title matches exactly. Use IWiktionary.getPagesForWord(String, boolean) for case insensitive and string-normalized matching.

Throws:
IllegalStateException - if the connection has already been closed.
WiktionaryException - upon database errors.

getPagesForWord

List<IWiktionaryPage> getPagesForWord(String word,
                                      IWiktionaryPageFilter filter)
Returns all pages with the given title. The method only returns the page if its title matches exactly. Use IWiktionary.getPagesForWord(String, boolean) for case insensitive and string-normalized matching. Using the given IWiktionaryPageFilter, unwanted pages can be ignored.

Throws:
IllegalStateException - if the connection has already been closed.
WiktionaryException - upon database errors.

getSenseForKey

IWiktionarySense getSenseForKey(String key,
                                ILanguage language)
Returns the word sense with the given (edition-specific) unique id. Note that this id is only stable over the same XML dump and JWKTL version.

Throws:
IllegalStateException - if the connection has already been closed.
WiktionaryException - upon database errors.


Copyright © 2011-2013 Ubiquitous Knowledge Processing (UKP) Lab. All Rights Reserved.