de.tudarmstadt.ukp.jwktl.api
Interface IWiktionary

All Known Subinterfaces:
IWiktionaryCollection, IWiktionaryEdition, IWritableWiktionaryEdition
All Known Implementing Classes:
AbstractWiktionary, BerkeleyDBWiktionaryEdition, WiktionaryCollection, WiktionaryEdition, WritableBerkeleyDBWiktionaryEdition

public interface IWiktionary

Base interface for the Wiktionary language edition and collection modelling common methods for querying and iterating over the encoded entries.

Author:
Christian M. Meyer

Method Summary
 void close()
          Disconnects from the database.
 IWiktionaryIterator<IWiktionaryEntry> getAllEntries()
          Returns an iterator over all IWiktionaryEntrys within the Wiktionary edition.
 IWiktionaryIterator<IWiktionaryEntry> getAllEntries(boolean sortByTitle)
          Returns an iterator over all IWiktionaryEntrys within the Wiktionary edition.
 IWiktionaryIterator<IWiktionaryEntry> getAllEntries(boolean sortByTitle, boolean normalize)
          Returns an iterator over all IWiktionaryEntrys within the Wiktionary edition.
 IWiktionaryIterator<IWiktionaryEntry> getAllEntries(IWiktionaryEntryFilter filter)
          Returns an iterator over all IWiktionaryEntrys within the Wiktionary edition.
 IWiktionaryIterator<IWiktionaryEntry> getAllEntries(IWiktionaryEntryFilter filter, boolean sortByTitle)
          Returns an iterator over all IWiktionaryEntrys within the Wiktionary edition.
 IWiktionaryIterator<IWiktionaryEntry> getAllEntries(IWiktionaryEntryFilter filter, boolean sortByTitle, boolean normalize)
          Returns an iterator over all IWiktionaryEntrys within the Wiktionary edition.
 IWiktionaryIterator<IWiktionaryPage> getAllPages()
          Returns an iterator over all IWiktionaryPages within the Wiktionary edition.
 IWiktionaryIterator<IWiktionaryPage> getAllPages(boolean sortByTitle)
          Returns an iterator over all IWiktionaryPages within the Wiktionary edition.
 IWiktionaryIterator<IWiktionaryPage> getAllPages(boolean sortByTitle, boolean normalize)
          Returns an iterator over all IWiktionaryPages within the Wiktionary edition.
 IWiktionaryIterator<IWiktionaryPage> getAllPages(IWiktionaryPageFilter filter)
          Returns an iterator over all IWiktionaryPages within the Wiktionary edition.
 IWiktionaryIterator<IWiktionaryPage> getAllPages(IWiktionaryPageFilter filter, boolean sortByTitle)
          Returns an iterator over all IWiktionaryPages 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()
          Returns an iterator over all IWiktionarySenses within the Wiktionary edition.
 IWiktionaryIterator<IWiktionarySense> getAllSenses(boolean sortByTitle)
          Returns an iterator over all IWiktionaryEntrys within the Wiktionary edition.
 IWiktionaryIterator<IWiktionarySense> getAllSenses(boolean sortByTitle, boolean normalize)
          Returns an iterator over all IWiktionaryEntrys within the Wiktionary edition.
 IWiktionaryIterator<IWiktionarySense> getAllSenses(IWiktionarySenseFilter filter)
          Returns an iterator over all IWiktionarySenses within the Wiktionary edition.
 IWiktionaryIterator<IWiktionarySense> getAllSenses(IWiktionarySenseFilter filter, boolean sortByTitle)
          Returns an iterator over all IWiktionaryEntrys within the Wiktionary edition.
 IWiktionaryIterator<IWiktionarySense> getAllSenses(IWiktionarySenseFilter filter, boolean sortByTitle, boolean normalize)
          Returns an iterator over all IWiktionaryEntrys within the Wiktionary edition.
 List<IWiktionaryEntry> getEntriesForWord(String word)
          Returns a list of IWiktionaryEntrys encoded on a page with the given title.
 List<IWiktionaryEntry> getEntriesForWord(String word, boolean normalize)
          Returns a list of IWiktionaryEntrys encoded on a page with the given title.
 List<IWiktionaryEntry> getEntriesForWord(String word, IWiktionaryEntryFilter filter)
          Returns a list of IWiktionaryEntrys encoded on a page with the given title.
 List<IWiktionaryEntry> getEntriesForWord(String word, IWiktionaryEntryFilter filter, boolean normalize)
          Returns a list of IWiktionaryEntrys encoded on a page with the given title.
 List<IWiktionaryPage> getPagesForWord(String word, boolean normalize)
          Returns the page with the given title.
 List<IWiktionaryPage> getPagesForWord(String word, IWiktionaryPageFilter filter, boolean normalize)
          Returns the page with the given title.
 List<IWiktionarySense> getSensesForWord(String word)
          Returns a list of IWiktionarySenses encoded on a page with the given title.
 List<IWiktionarySense> getSensesForWord(String word, boolean normalize)
          Returns a list of IWiktionarySenses encoded on a page with the given title.
 List<IWiktionarySense> getSensesForWord(String word, IWiktionarySenseFilter filter)
          Returns a list of IWiktionarySenses encoded on a page with the given title.
 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 close() method.
 

Method Detail

getPagesForWord

List<IWiktionaryPage> getPagesForWord(String word,
                                      boolean normalize)
Returns the page with the given title. The method returns also pages, whose title matches in a case insensitive or string-normalized manner. The latter means that strings are converted to lower case, and umlauts or accents are substituted by their canonical form. The word "prêt-à-porter" is, e.g., normalized to "pret-a-porter". Use false for exact matches.

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

getPagesForWord

List<IWiktionaryPage> getPagesForWord(String word,
                                      IWiktionaryPageFilter filter,
                                      boolean normalize)
Returns the page with the given title. The method returns also pages, whose title matches in a case insensitive or string-normalized manner. The latter means that strings are converted to lower case, and umlauts or accents are substituted by their canonical form. The word "prêt-à-porter" is, e.g., normalized to "pret-a-porter". Using the given IWiktionaryPageFilter, unwanted pages can be ignored.

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

getAllPages

IWiktionaryIterator<IWiktionaryPage> getAllPages()
Returns an iterator over all IWiktionaryPages within the Wiktionary edition. The pages are sorted by their page id.


getAllPages

IWiktionaryIterator<IWiktionaryPage> getAllPages(boolean sortByTitle)
Returns an iterator over all IWiktionaryPages within the Wiktionary edition.

Parameters:
sortByTitle - if true sort by page title (case sensitive); otherwise by page id.

getAllPages

IWiktionaryIterator<IWiktionaryPage> getAllPages(boolean sortByTitle,
                                                 boolean normalize)
Returns an iterator over all IWiktionaryPages within the Wiktionary edition.

Parameters:
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).

getAllPages

IWiktionaryIterator<IWiktionaryPage> getAllPages(IWiktionaryPageFilter filter)
Returns an iterator over all IWiktionaryPages within the Wiktionary edition. The pages are sorted by their page id. Using the given IWiktionaryPageFilter, unwanted pages can be ignored.


getAllPages

IWiktionaryIterator<IWiktionaryPage> getAllPages(IWiktionaryPageFilter filter,
                                                 boolean sortByTitle)
Returns an iterator over all IWiktionaryPages within the Wiktionary edition. Using the given IWiktionaryPageFilter, unwanted pages can be ignored.

Parameters:
sortByTitle - if true sort by page title (case sensitive); otherwise by page id.

getAllPages

IWiktionaryIterator<IWiktionaryPage> getAllPages(IWiktionaryPageFilter filter,
                                                 boolean sortByTitle,
                                                 boolean normalize)
Returns an iterator over all IWiktionaryPages within the Wiktionary edition. Using the given IWiktionaryPageFilter, unwanted pages can be ignored.

Parameters:
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).

getEntriesForWord

List<IWiktionaryEntry> getEntriesForWord(String word)
Returns a list of IWiktionaryEntrys encoded on a page with the given title. The method only returns an entry if the page title matches exactly. Use getEntriesForWord(String, boolean) for case insensitive and string-normalized matching.

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

getEntriesForWord

List<IWiktionaryEntry> getEntriesForWord(String word,
                                         boolean normalize)
Returns a list of IWiktionaryEntrys encoded on a page with the given title.

Parameters:
normalize - if true, match the page title in a case insensitive manner.
Throws:
IllegalStateException - if the connection has already been closed.
WiktionaryException - upon database errors.

getEntriesForWord

List<IWiktionaryEntry> getEntriesForWord(String word,
                                         IWiktionaryEntryFilter filter)
Returns a list of IWiktionaryEntrys encoded on a page with the given title. The method only returns an entry if the page title matches exactly. Use getEntriesForWord(String, boolean) for case insensitive and string-normalized matching. Using the given IWiktionaryEntryFilter, unwanted entries can be ignored.

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

getEntriesForWord

List<IWiktionaryEntry> getEntriesForWord(String word,
                                         IWiktionaryEntryFilter filter,
                                         boolean normalize)
Returns a list of IWiktionaryEntrys encoded on a page with the given title. Using the given IWiktionaryEntryFilter, unwanted entries can be ignored.

Parameters:
normalize - if true, match the page title in a case insensitive manner.
Throws:
IllegalStateException - if the connection has already been closed.
WiktionaryException - upon database errors.

getAllEntries

IWiktionaryIterator<IWiktionaryEntry> getAllEntries()
Returns an iterator over all IWiktionaryEntrys within the Wiktionary edition. This is equivalent to iterating over all pages using getAllPages() and then over the page's entries using IWiktionaryPage.getEntries(). The pages are sorted by their page id; the entries by their index.


getAllEntries

IWiktionaryIterator<IWiktionaryEntry> getAllEntries(boolean sortByTitle)
Returns an iterator over all IWiktionaryEntrys within the Wiktionary edition. This is equivalent to iterating over all pages using getAllPages(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.

Parameters:
sortByTitle - if true sort by page title (case sensitive); otherwise by page id.

getAllEntries

IWiktionaryIterator<IWiktionaryEntry> getAllEntries(boolean sortByTitle,
                                                    boolean normalize)
Returns an iterator over all IWiktionaryEntrys within the Wiktionary edition. This is equivalent to iterating over all pages using 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.

Parameters:
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).

getAllEntries

IWiktionaryIterator<IWiktionaryEntry> getAllEntries(IWiktionaryEntryFilter filter)
Returns an iterator over all IWiktionaryEntrys within the Wiktionary edition. This is equivalent to iterating over all pages using getAllPages() and then over the page's entries using IWiktionaryPage.getEntries(). The pages are sorted by their page id; the entries by their index. Using the given IWiktionaryEntryFilter, unwanted entries can be ignored.


getAllEntries

IWiktionaryIterator<IWiktionaryEntry> getAllEntries(IWiktionaryEntryFilter filter,
                                                    boolean sortByTitle)
Returns an iterator over all IWiktionaryEntrys within the Wiktionary edition. This is equivalent to iterating over all pages using getAllPages(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.

Parameters:
sortByTitle - if true sort by page title (case sensitive); otherwise by page id.

getAllEntries

IWiktionaryIterator<IWiktionaryEntry> getAllEntries(IWiktionaryEntryFilter filter,
                                                    boolean sortByTitle,
                                                    boolean normalize)
Returns an iterator over all IWiktionaryEntrys within the Wiktionary edition. This is equivalent to iterating over all pages using 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.

Parameters:
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).

getSensesForWord

List<IWiktionarySense> getSensesForWord(String word)
Returns a list of IWiktionarySenses encoded on a page with the given title. The method only returns the senses if the page title matches exactly. Use getSensesForWord(String, boolean) for case insensitive and string-normalized matching.

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

getSensesForWord

List<IWiktionarySense> getSensesForWord(String word,
                                        boolean normalize)
Returns a list of IWiktionarySenses encoded on a page with the given title.

Parameters:
normalize - if true, match the page title in a case insensitive manner.
Throws:
IllegalStateException - if the connection has already been closed.
WiktionaryException - upon database errors.

getSensesForWord

List<IWiktionarySense> getSensesForWord(String word,
                                        IWiktionarySenseFilter filter)
Returns a list of IWiktionarySenses encoded on a page with the given title. The method only returns the senses if the page title matches exactly. Use getSensesForWord(String, boolean) for case insensitive and string-normalized matching. Using the given IWiktionarySenseFilter, unwanted word senses can be ignored.

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

getSensesForWord

List<IWiktionarySense> getSensesForWord(String word,
                                        IWiktionarySenseFilter filter,
                                        boolean normalize)
Returns a list of IWiktionarySenses encoded on a page with the given title. Using the given IWiktionarySenseFilter, unwanted word senses can be ignored.

Parameters:
normalize - if true, match the page title in a case insensitive manner.
Throws:
IllegalStateException - if the connection has already been closed.
WiktionaryException - upon database errors.

getAllSenses

IWiktionaryIterator<IWiktionarySense> getAllSenses()
Returns an iterator over all IWiktionarySenses within the Wiktionary edition. This is equivalent to iterating over all pages using getAllPages() and then over the page's entries using IWiktionaryPage.getEntries() and then over the entry's senses using IWiktionaryEntry.getSenses(). The pages are sorted by their page id; the entries and senses by their index.


getAllSenses

IWiktionaryIterator<IWiktionarySense> getAllSenses(boolean sortByTitle)
Returns an iterator over all IWiktionaryEntrys within the Wiktionary edition. This is equivalent to iterating over all pages using getAllPages(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.

Parameters:
sortByTitle - if true sort by page title (case sensitive); otherwise by page id.

getAllSenses

IWiktionaryIterator<IWiktionarySense> getAllSenses(boolean sortByTitle,
                                                   boolean normalize)
Returns an iterator over all IWiktionaryEntrys within the Wiktionary edition. This is equivalent to iterating over all pages using 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.

Parameters:
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).

getAllSenses

IWiktionaryIterator<IWiktionarySense> getAllSenses(IWiktionarySenseFilter filter)
Returns an iterator over all IWiktionarySenses within the Wiktionary edition. This is equivalent to iterating over all pages using getAllPages() and then over the page's entries using IWiktionaryPage.getEntries() and then over the entry's senses using IWiktionaryEntry.getSenses(). The pages are sorted by their page id; the entries and senses by their index. Using the given IWiktionarySenseFilter, unwanted word senses can be ignored.


getAllSenses

IWiktionaryIterator<IWiktionarySense> getAllSenses(IWiktionarySenseFilter filter,
                                                   boolean sortByTitle)
Returns an iterator over all IWiktionaryEntrys within the Wiktionary edition. This is equivalent to iterating over all pages using getAllPages(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.

Parameters:
sortByTitle - if true sort by page title (case sensitive); otherwise by page id.

getAllSenses

IWiktionaryIterator<IWiktionarySense> getAllSenses(IWiktionarySenseFilter filter,
                                                   boolean sortByTitle,
                                                   boolean normalize)
Returns an iterator over all IWiktionaryEntrys within the Wiktionary edition. This is equivalent to iterating over all pages using 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.

Parameters:
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).

close

void close()
Disconnects from the database. This is necessary to ensure the consistency of the data. No retrieval methods can be called after closing the connection, so this should be done prior to terminating the application. Nothing happens on calling the method more than once.


isClosed

boolean isClosed()
Returns true if the database connection has already been closed using the close() method.



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