de.tudarmstadt.ukp.jwktl.api
Interface IWiktionaryEdition

All Superinterfaces:
IWiktionary
All Known Subinterfaces:
IWritableWiktionaryEdition
All Known Implementing Classes:
BerkeleyDBWiktionaryEdition, WiktionaryEdition, WritableBerkeleyDBWiktionaryEdition

public interface IWiktionaryEdition
extends IWiktionary

Models a single Wiktionary language edition (e.g., the English Wiktionary) for which this interface provides multiple querying and iteration methods.

Author:
Christian M. Meyer

Method Summary
 File getDBPath()
          Returns the file path of the parsed database.
 IWiktionaryEntry getEntryForId(long entryId)
          Returns the IWiktionaryEntry with the given entry id.
 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.
 ILanguage getLanguage()
          Returns the language of the Wiktionary edition, which is equivalent to the entry language of the contained entries.
 IWiktionaryPage getPageForId(long id)
          Returns the page with the given unique id.
 IWiktionaryPage getPageForWord(String word)
          Returns the page with the given title.
 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.
 IWiktionarySense getSenseForKey(String id)
          Returns the word sense with the given unique id.
 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.
 
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

getLanguage

ILanguage getLanguage()
Returns the language of the Wiktionary edition, which is equivalent to the entry language of the contained entries.


getDBPath

File getDBPath()
Returns the file path of the parsed database.


getPageForId

IWiktionaryPage getPageForId(long id)
Returns the page with the given unique id.

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

getPageForWord

IWiktionaryPage getPageForWord(String word)
Returns the page 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.

getEntryForId

IWiktionaryEntry getEntryForId(long entryId)
Returns the IWiktionaryEntry with the given entry 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.

getEntryForId

IWiktionaryEntry getEntryForId(long pageId,
                               int entryIdx)
Returns the 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.

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

getEntryForWord

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. The method only returns the entries if the page title matches exactly.

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

getSenseForKey

IWiktionarySense getSenseForKey(String id)
Returns the word sense with the given 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.

getSenseForId

IWiktionarySense getSenseForId(long entryId,
                               int senseIdx)
Returns the word sense with the given entry id and sense index. Note that this id combination is only stable over the same XML dump and JWKTL version.

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

getSenseForId

IWiktionarySense getSenseForId(long pageId,
                               int entryIdx,
                               int senseIdx)
Returns the word sense with the given page id, entry index, and sense index. Note that this id combination is only stable over the same XML dump and JWKTL version.

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

getSensesForWord

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. The method only returns the senses if the page title matches exactly.

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

getSensesForWord

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. The method only returns the sense if the page title matches exactly.

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


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