public class SwJLanguageTool extends Object
Constructor and Description |
---|
SwJLanguageTool(Language language,
Language motherTongue,
UserConfig userConfig,
Configuration config,
List<Rule> extraRemoteRules,
boolean testMode) |
Modifier and Type | Method and Description |
---|---|
void |
activateLanguageModelRules(File indexDir)
Activate language model (ngram) rules
|
List<AnalyzedSentence> |
analyzeText(String text)
Analyze text
This Method may be used only for local checks
use local lt for remote checks
|
List<RuleMatch> |
check(String text,
boolean tokenizeText,
JLanguageTool.ParagraphHandling paraMode)
check text by LT
default: check only grammar
local: LT checks only grammar (spell check is not implemented locally)
remote: spell checking is used for LT check dialog (is needed because method getAnalyzedSentence is not supported by remote check)
|
List<RuleMatch> |
check(String text,
boolean tokenizeText,
JLanguageTool.ParagraphHandling paraMode,
OfficeTools.RemoteCheck checkMode) |
void |
disableCategory(CategoryId id)
Disable a category by ID
|
void |
disableRule(String ruleId)
Disable a rule by ID
|
boolean |
doReset()
Set reset flag
|
void |
enableRule(String ruleId)
Enable a rule by ID
|
List<Rule> |
getAllActiveOfficeRules()
Get all active office rules
|
List<Rule> |
getAllActiveRules()
Get all active rules
|
List<Rule> |
getAllRules()
Get all rules
|
AnalyzedSentence |
getAnalyzedSentence(String sentence)
Analyze sentence
This Method may be used only for local checks
use local lt for remote checks
|
Set<String> |
getDisabledRules()
Get disabled rules
|
Language |
getLanguage()
Get the language from LT
|
List<String> |
getLemmasOfWord(String word)
get the lemmas of a word
|
boolean |
isRemote()
Return true if check is done by a remote server
|
List<String> |
sentenceTokenize(String text)
Get a list of tokens from a sentence
This Method may be used only for local checks
use local lt for remote checks
|
public SwJLanguageTool(Language language, Language motherTongue, UserConfig userConfig, Configuration config, List<Rule> extraRemoteRules, boolean testMode) throws MalformedURLException
MalformedURLException
public boolean isRemote()
public void enableRule(String ruleId)
public void disableRule(String ruleId)
public void disableCategory(CategoryId id)
public void activateLanguageModelRules(File indexDir) throws IOException
IOException
public List<RuleMatch> check(String text, boolean tokenizeText, JLanguageTool.ParagraphHandling paraMode) throws IOException
IOException
public List<RuleMatch> check(String text, boolean tokenizeText, JLanguageTool.ParagraphHandling paraMode, OfficeTools.RemoteCheck checkMode) throws IOException
IOException
public List<String> sentenceTokenize(String text)
public AnalyzedSentence getAnalyzedSentence(String sentence) throws IOException
IOException
public List<AnalyzedSentence> analyzeText(String text) throws IOException
IOException
public List<String> getLemmasOfWord(String word) throws IOException
IOException
public Language getLanguage()
public boolean doReset()