Package org.languagetool.dev.wikipedia
Class WikipediaQuickCheck
java.lang.Object
org.languagetool.dev.wikipedia.WikipediaQuickCheck
Check a Wikipedia page (without spell check), fetching the page via the MediaWiki API.
-
Constructor Summary
ConstructorsConstructorDescriptionWikipediaQuickCheck(File ngramDir) WikipediaQuickCheck(File ngramDir, int maxSizeBytes) -
Method Summary
Modifier and TypeMethodDescriptioncheckPage(URL url, ErrorMarker errorMarker) getLanguage(URL url) getMediaWikiContent(URL wikipediaUrl) getPageTitle(URL url) getPlainText(String completeWikiContent) getPlainTextMapping(String completeWikiContent) static voidvoidsetDisabledRuleIds(List<String> ruleIds) voidvalidateWikipediaUrl(URL wikipediaUrl)
-
Constructor Details
-
WikipediaQuickCheck
public WikipediaQuickCheck() -
WikipediaQuickCheck
- Parameters:
ngramDir- directory with sub directories like 'en', 'de' etc that contain '1grams' etc directories with ngram data (Lucene indexes)- Since:
- 3.1
-
WikipediaQuickCheck
- Parameters:
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 exception- Since:
- 3.3
-
-
Method Details
-
getMediaWikiContent
- Throws:
IOException
-
getLanguage
-
getPageTitle
-
setDisabledRuleIds
-
getDisabledRuleIds
-
checkPage
- Throws:
IOExceptionPageNotFoundException
-
checkPage
public MarkupAwareWikipediaResult checkPage(URL url, ErrorMarker errorMarker) throws IOException, PageNotFoundException - Throws:
IOExceptionPageNotFoundException- Since:
- 2.6
-
checkPage
- Throws:
IOException
-
validateWikipediaUrl
-
getPlainText
- Parameters:
completeWikiContent- the Mediawiki syntax as it comes from the API, including surrounding XML
-
getPlainTextMapping
- Parameters:
completeWikiContent- the Mediawiki syntax as it comes from the API, including surrounding XML
-
main
- Throws:
IOExceptionPageNotFoundException
-