|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.tudarmstadt.ukp.jwktl.api.entry.AbstractWiktionary
de.tudarmstadt.ukp.jwktl.api.entry.WiktionaryCollection
public class WiktionaryCollection
Default implementation of the IWiktionaryCollection
interface. The
implementation can be initialized with multiple IWiktionaryEdition
s
in order to access parsed Wiktionary information of multiple language
editions.
Field Summary | |
---|---|
protected List<IWiktionaryEdition> |
editions
|
Constructor Summary | |
---|---|
WiktionaryCollection()
Initializes the Wiktionary collection. |
Method Summary | |
---|---|
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. |
Methods inherited from class de.tudarmstadt.ukp.jwktl.api.entry.AbstractWiktionary |
---|
getAllEntries, getAllEntries, getAllEntries, getAllEntries, getAllEntries, getAllPages, getAllPages, getAllPages, getAllPages, getAllPages, getAllSenses, getAllSenses, getAllSenses, getAllSenses, getAllSenses, getEntriesForWord, getEntriesForWord, getEntriesForWord, getPagesForWord, getSensesForWord, getSensesForWord, getSensesForWord |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface de.tudarmstadt.ukp.jwktl.api.IWiktionary |
---|
getAllEntries, getAllEntries, getAllEntries, getAllEntries, getAllEntries, getAllPages, getAllPages, getAllPages, getAllPages, getAllPages, getAllSenses, getAllSenses, getAllSenses, getAllSenses, getAllSenses, getEntriesForWord, getEntriesForWord, getEntriesForWord, getPagesForWord, getSensesForWord, getSensesForWord, getSensesForWord |
Field Detail |
---|
protected List<IWiktionaryEdition> editions
Constructor Detail |
---|
public WiktionaryCollection()
Method Detail |
---|
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
public boolean isClosed()
IWiktionary
true
if the database connection has already been
closed using the IWiktionary.close()
method.
isClosed
in interface IWiktionary
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |