public class WritableBerkeleyDBWiktionaryEdition extends BerkeleyDBWiktionaryEdition implements IWritableWiktionaryEdition
BerkeleyDBWiktionaryEdition.WiktionaryEntryProxy, BerkeleyDBWiktionaryEdition.WiktionarySenseProxy| Modifier and Type | Field and Description |
|---|---|
protected long |
entryCount |
protected boolean |
entryIndexByTitle |
protected long |
pageCount |
protected long |
senseCount |
DATABASE_NAME, dbPath, entryById, entryByKey, env, language, openCursors, pageById, pageByNormalizedTitle, pageByTitle, properties, PROPERTY_FILE_NAME, senseByKey, storeisClosed| Constructor and Description |
|---|
WritableBerkeleyDBWiktionaryEdition(File dbPath,
boolean overwriteExisting)
Shorthand for
WritableBerkeleyDBWiktionaryEdition(File,
boolean, Long) with a cacheSize set to half the size of the the +
current JWM max memory. |
WritableBerkeleyDBWiktionaryEdition(File dbPath,
boolean overwriteExisting,
Long cacheSize)
Instanciates the writable Wiktionary database for the given
database path.
|
| Modifier and Type | Method and Description |
|---|---|
void |
commit()
Force a database commit of the pages saved so far.
|
protected void |
connect(boolean isReadOnly,
boolean allowCreateNew,
boolean overwriteExisting,
Long cacheSize) |
boolean |
getEntryIndexByTitle()
Returns the setting if
IWiktionaryEntrys should be ordered
alphabetically. |
void |
savePage(WiktionaryPage page)
Adds the given Wiktionary page to the database.
|
void |
saveProperties(IDumpInfo dumpInfo)
Hotspot called after parsing has finished to save the metadata
of the dump file and the basic parsing statistics.
|
void |
setEntryIndexByTitle(boolean entryIndexByTitle)
Sorts the entries by word form before assigning an ID to them.
|
void |
setLanguage(ILanguage language)
Assigns the given language to the Wiktionary edition.
|
deleteParsedWiktionary, doClose, getAllPages, getDBName, getDBPath, getEntryForId, getLanguage, getPageForId, getPageForWord, getPagesForWord, getSenseForKey, loadPage, prepareTargetDirectoryclose, ensureOpen, getAllEntries, getAllSenses, getEntriesForWord, getEntryForId, getEntryForWord, getSenseForId, getSenseForId, getSensesForWord, getSensesForWord, getSensesForWord, isClosedgetAllEntries, getAllEntries, getAllEntries, getAllEntries, getAllEntries, getAllPages, getAllPages, getAllPages, getAllPages, getAllPages, getAllSenses, getAllSenses, getAllSenses, getAllSenses, getAllSenses, getEntriesForWord, getEntriesForWord, getEntriesForWord, getPagesForWord, getSensesForWord, getSensesForWord, getSensesForWordclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetPageForId, getPageForWordgetDBPath, getEntryForId, getEntryForId, getEntryForWord, getLanguage, getSenseForId, getSenseForId, getSenseForKey, getSensesForWord, getSensesForWordclose, 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, isClosedprotected long pageCount
protected long entryCount
protected long senseCount
protected boolean entryIndexByTitle
public WritableBerkeleyDBWiktionaryEdition(File dbPath, boolean overwriteExisting)
WritableBerkeleyDBWiktionaryEdition(File,
boolean, Long) with a cacheSize set to half the size of the the +
current JWM max memory.public WritableBerkeleyDBWiktionaryEdition(File dbPath, boolean overwriteExisting, Long cacheSize)
overwriteExisting - if set to false, parsing a
Wiktionary dump using this database will cause an exception if the
database path is not empty. Otherwise, an existing parsed Wiktionary
database will be overwritten.cacheSize - denotes the size of the cache (in Bytes) used by the
Berkeley DB.protected void connect(boolean isReadOnly,
boolean allowCreateNew,
boolean overwriteExisting,
Long cacheSize)
throws com.sleepycat.je.DatabaseException
connect in class BerkeleyDBWiktionaryEditioncom.sleepycat.je.DatabaseExceptionpublic boolean getEntryIndexByTitle()
IWiktionaryEntrys should be ordered
alphabetically.public void setEntryIndexByTitle(boolean entryIndexByTitle)
IWritableWiktionaryEditionsetEntryIndexByTitle in interface IWritableWiktionaryEditionpublic void setLanguage(ILanguage language)
IWritableWiktionaryEditionsetLanguage in interface IWritableWiktionaryEditionpublic void commit()
throws WiktionaryException
IWritableWiktionaryEditioncommit in interface IWritableWiktionaryEditionWiktionaryExceptionpublic void saveProperties(IDumpInfo dumpInfo) throws WiktionaryException
IWritableWiktionaryEditionsaveProperties in interface IWritableWiktionaryEditionWiktionaryExceptionpublic void savePage(WiktionaryPage page) throws com.sleepycat.je.DatabaseException
savePage in interface IWritableWiktionaryEditioncom.sleepycat.je.DatabaseException - if the page could not be stored, which is,
i.e. the case if the DB is in read-only mode.Copyright © 2011-2016 Ubiquitous Knowledge Processing (UKP) Lab. All Rights Reserved.