public class WiktionaryArticleParser extends WiktionaryPageParser<WiktionaryPage>
IWiktionaryEntryParser
, which
is either automatically detected from the Wiktionary's base URL, or
specified in the constructor. Note that each directory can only
contain one Wiktionary database.Modifier and Type | Field and Description |
---|---|
protected IWiktionaryEntryParser |
entryParser |
protected IWritableWiktionaryEdition |
wiktionaryDB |
currentNamespace, dumpInfo, page
Constructor and Description |
---|
WiktionaryArticleParser(IWritableWiktionaryEdition wiktionaryDB)
Creates a caching article parser that saves the parsed Wiktionary
data into a Berkeley DB within the given target directory.
|
WiktionaryArticleParser(IWritableWiktionaryEdition wiktionaryDB,
IWiktionaryEntryParser entryParser)
Creates a caching article parser that saves the parsed Wiktionary
data into a Berkeley DB within the given target directory.
|
Modifier and Type | Method and Description |
---|---|
protected WiktionaryPage |
createPage() |
protected boolean |
isAllowed(IWiktionaryPage page) |
void |
onClose(IDumpInfo dumpInfo)
Hotspot that is invoked after the parser has finished its work.
|
void |
onPageEnd()
Hotspot that is invoked upon finishing the current article page.
|
void |
onSiteInfoComplete(IDumpInfo dumpInfo)
Hotspot that is invoked after the siteinfo header has been read.
|
protected void |
saveParsedWiktionaryPage() |
void |
setText(String text)
Hotspot that is invoked after the current page's text is read.
|
onPageStart, onParserEnd, onParserStart, setAuthor, setPageId, setRevision, setTimestamp, setTitle
protected IWritableWiktionaryEdition wiktionaryDB
protected IWiktionaryEntryParser entryParser
public WiktionaryArticleParser(IWritableWiktionaryEdition wiktionaryDB) throws WiktionaryException
WiktionaryException
- if the target dictionary is not empty
and overwriteExisting was set to false.public WiktionaryArticleParser(IWritableWiktionaryEdition wiktionaryDB, IWiktionaryEntryParser entryParser) throws WiktionaryException
WiktionaryException
- if the target dictionary is not empty
and overwriteExisting was set to false.public void onSiteInfoComplete(IDumpInfo dumpInfo)
IWiktionaryPageParser
onSiteInfoComplete
in interface IWiktionaryPageParser
onSiteInfoComplete
in class WiktionaryPageParser<WiktionaryPage>
public void onPageEnd()
IWiktionaryPageParser
onPageEnd
in interface IWiktionaryPageParser
onPageEnd
in class WiktionaryPageParser<WiktionaryPage>
public void onClose(IDumpInfo dumpInfo)
IWiktionaryPageParser
IWiktionaryPageParser.onParserEnd(IDumpInfo)
calls have been handled.onClose
in interface IWiktionaryPageParser
onClose
in class WiktionaryPageParser<WiktionaryPage>
protected WiktionaryPage createPage()
createPage
in class WiktionaryPageParser<WiktionaryPage>
public void setText(String text)
IWiktionaryPageParser
setText
in interface IWiktionaryPageParser
setText
in class WiktionaryPageParser<WiktionaryPage>
protected void saveParsedWiktionaryPage()
protected boolean isAllowed(IWiktionaryPage page)
Copyright © 2011-2016 Ubiquitous Knowledge Processing (UKP) Lab. All Rights Reserved.