public class MultiThreadedJLanguageTool extends JLanguageTool
JLanguageTool that uses several threads for rule matching.
Use this if you want text checking to be fast and do not care about the
high load that this might cause. Call shutdown() when you don't need
the object anymore.
Also see the javadoc of JLanguageTool.
Thread-safety: See the remarks at JLanguageTool.
JLanguageTool.ParagraphHandlingBUILD_DATE, FALSE_FRIEND_FILE, MESSAGE_BUNDLE, PARAGRAPH_END_TAGNAME, PATTERN_FILE, SENTENCE_END_TAGNAME, SENTENCE_START_TAGNAME, VERSION| Constructor and Description |
|---|
MultiThreadedJLanguageTool(Language language) |
MultiThreadedJLanguageTool(Language language,
int threadPoolSize) |
MultiThreadedJLanguageTool(Language language,
Language motherTongue) |
MultiThreadedJLanguageTool(Language language,
Language motherTongue,
int threadPoolSize) |
| Modifier and Type | Method and Description |
|---|---|
protected List<AnalyzedSentence> |
analyzeSentences(List<String> sentences) |
protected ExecutorService |
getExecutorService() |
protected int |
getThreadPoolSize()
When no thread pool size is configured, the number of available processors is returned.
|
protected List<RuleMatch> |
performCheck(List<AnalyzedSentence> analyzedSentences,
List<String> sentences,
List<Rule> allRules,
JLanguageTool.ParagraphHandling paraMode,
AnnotatedText annotatedText) |
void |
shutdown()
Call this to shut down the internally used thread pool.
|
activateLanguageModelRules, addRule, addTemporaryFile, adjustRuleMatchPos, analyzeText, check, check, check, check, checkAnalyzedSentence, checkAnalyzedSentence, disableCategory, disableRule, disableRules, enableDefaultOffRule, enableRule, getAllActiveRules, getAllRules, getAnalyzedSentence, getDataBroker, getDisabledCategories, getDisabledRules, getLanguage, getMessageBundle, getMessageBundle, getPatternRulesByIdAndSubId, getRawAnalyzedSentence, getSentenceCount, getUnknownWords, loadFalseFriendRules, loadPatternRules, printIfVerbose, printSentenceInfo, rememberUnknownWords, removeTemporaryFiles, sentenceTokenize, setDataBroker, setListUnknownWords, setOutputpublic MultiThreadedJLanguageTool(Language language)
public MultiThreadedJLanguageTool(Language language, int threadPoolSize)
threadPoolSize - the number of concurrent threadsshutdown()public MultiThreadedJLanguageTool(Language language, Language motherTongue)
shutdown()public MultiThreadedJLanguageTool(Language language, Language motherTongue, int threadPoolSize)
threadPoolSize - the number of concurrent threadsshutdown()public void shutdown()
protected int getThreadPoolSize()
protected ExecutorService getExecutorService()
protected List<AnalyzedSentence> analyzeSentences(List<String> sentences) throws IOException
analyzeSentences in class JLanguageToolIOExceptionprotected List<RuleMatch> performCheck(List<AnalyzedSentence> analyzedSentences, List<String> sentences, List<Rule> allRules, JLanguageTool.ParagraphHandling paraMode, AnnotatedText annotatedText) throws IOException
performCheck in class JLanguageToolIOException