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, store
isClosed
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
IWiktionaryEntry s 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, prepareTargetDirectory
close, ensureOpen, getAllEntries, getAllSenses, getEntriesForWord, getEntryForId, getEntryForWord, getSenseForId, getSenseForId, getSensesForWord, getSensesForWord, getSensesForWord, isClosed
getAllEntries, getAllEntries, getAllEntries, getAllEntries, getAllEntries, getAllPages, getAllPages, getAllPages, getAllPages, getAllPages, getAllSenses, getAllSenses, getAllSenses, getAllSenses, getAllSenses, getEntriesForWord, getEntriesForWord, getEntriesForWord, getPagesForWord, getSensesForWord, getSensesForWord, getSensesForWord
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getPageForId, getPageForWord
getDBPath, getEntryForId, getEntryForId, getEntryForWord, getLanguage, getSenseForId, getSenseForId, getSenseForKey, getSensesForWord, getSensesForWord
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
protected 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 BerkeleyDBWiktionaryEdition
com.sleepycat.je.DatabaseException
public boolean getEntryIndexByTitle()
IWiktionaryEntry
s should be ordered
alphabetically.public void setEntryIndexByTitle(boolean entryIndexByTitle)
IWritableWiktionaryEdition
setEntryIndexByTitle
in interface IWritableWiktionaryEdition
public void setLanguage(ILanguage language)
IWritableWiktionaryEdition
setLanguage
in interface IWritableWiktionaryEdition
public void commit() throws WiktionaryException
IWritableWiktionaryEdition
commit
in interface IWritableWiktionaryEdition
WiktionaryException
public void saveProperties(IDumpInfo dumpInfo) throws WiktionaryException
IWritableWiktionaryEdition
saveProperties
in interface IWritableWiktionaryEdition
WiktionaryException
public void savePage(WiktionaryPage page) throws com.sleepycat.je.DatabaseException
savePage
in interface IWritableWiktionaryEdition
com.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.