public class WikipediaQuickCheck extends Object
Constructor and Description |
---|
WikipediaQuickCheck() |
WikipediaQuickCheck(File ngramDir) |
WikipediaQuickCheck(File ngramDir,
int maxSizeBytes) |
Modifier and Type | Method and Description |
---|---|
WikipediaQuickCheckResult |
checkPage(String plainText,
Language lang) |
MarkupAwareWikipediaResult |
checkPage(URL url) |
MarkupAwareWikipediaResult |
checkPage(URL url,
ErrorMarker errorMarker) |
List<String> |
getDisabledRuleIds() |
Language |
getLanguage(URL url) |
String |
getMediaWikiContent(URL wikipediaUrl) |
String |
getPageTitle(URL url) |
String |
getPlainText(String completeWikiContent) |
PlainTextMapping |
getPlainTextMapping(String completeWikiContent) |
static void |
main(String[] args) |
void |
setDisabledRuleIds(List<String> ruleIds) |
void |
validateWikipediaUrl(URL wikipediaUrl) |
public WikipediaQuickCheck()
public WikipediaQuickCheck(File ngramDir)
ngramDir
- directory with sub directories like 'en', 'de' etc that contain '1grams' etc directories with ngram data (Lucene indexes)public WikipediaQuickCheck(File ngramDir, int maxSizeBytes)
ngramDir
- directory with sub directories like 'en', 'de' etc that contain '1grams' etc directories with ngram data (Lucene indexes)maxSizeBytes
- the maximum bytes of XML for the methods that take an URL, longer content will throw an exceptionpublic String getMediaWikiContent(URL wikipediaUrl) throws IOException
IOException
public MarkupAwareWikipediaResult checkPage(URL url) throws IOException, PageNotFoundException
IOException
PageNotFoundException
public MarkupAwareWikipediaResult checkPage(URL url, ErrorMarker errorMarker) throws IOException, PageNotFoundException
IOException
PageNotFoundException
public WikipediaQuickCheckResult checkPage(String plainText, Language lang) throws IOException
IOException
public void validateWikipediaUrl(URL wikipediaUrl)
public String getPlainText(String completeWikiContent)
completeWikiContent
- the Mediawiki syntax as it comes from the API, including surrounding XMLpublic PlainTextMapping getPlainTextMapping(String completeWikiContent)
completeWikiContent
- the Mediawiki syntax as it comes from the API, including surrounding XMLpublic static void main(String[] args) throws IOException, PageNotFoundException
IOException
PageNotFoundException