Class Configuration
java.lang.Object
org.languagetool.gui.Configuration
Configuration like list of disabled rule IDs, server mode etc.
Configuration is loaded from and stored to a properties file.
- Author:
- Daniel Naber
-
Constructor Summary
ConstructorsConstructorDescriptionConfiguration(File baseDir, String filename, File oldConfigFile, org.languagetool.Language lang, org.languagetool.LinguServices linguServices) Configuration(File baseDir, String filename, org.languagetool.Language lang) Configuration(File baseDir, String filename, org.languagetool.Language lang, org.languagetool.LinguServices linguServices) Configuration(File baseDir, org.languagetool.Language lang) Configuration(org.languagetool.Language lang) Uses the configuration file from the default location. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddDisabledRuleIds(Set<String> ruleIds) voidaddProfile(String profile) add a new profilevoidaddProfiles(List<String> profiles) add a list of profilesbooleando a full check at first iteration?booleanbooleanintgetConfigurableValue(String ruleID) returns all configured valuesget the current profileorg.languagetool.Languageget the current profilebooleanReturns the name of the GUI's editing textarea font.intReturns the size of the GUI's editing textarea font.intReturns the style of the GUI's editing textarea font.org.languagetool.LanguageReturns the name of the GUI's LaF.org.languagetool.Language@Nullable FileDirectory with ngram data or null.intget the number of paragraphs to be checked for TextLevelRulesbooleanintgetSpecialTabCategories(String tabName) String[]booleanDetermines whether the tagger window will also print the disambiguation log.getUnderlineColor(String category) booleanboolean@Nullable FileDirectory with word2vec data or null.voidInitialize variables and clears Maps, Sets and ListsvoidinitStyleCategories(List<org.languagetool.rules.Rule> allRules) booleanisInSpecialTab(String category, String tabName) booleanshall LO run in multi thread modebooleanwill all paragraphs not checked after every change of text if more than one document loaded?booleanwill all paragraphs check after every change of text?booleanisSpecialTabCategory(String category) booleanisStyleCategory(String category) booleanvoidloadConfiguration(String profile) voidremoveDisabledRuleIds(Set<String> ruleIds) voidremoveProfile(String profile) remove an existing profilevoidsaveConfiguration(org.languagetool.Language lang) voidsetAutoDetect(boolean autoDetect) voidsetConfigurableValue(String ruleID, int value) voidsetCurrentProfile(String profile) set the current profilevoidsetDefaultUnderlineColor(String category) voidsetDisabledCategoryNames(Set<String> categoryNames) voidsetDisabledRuleIds(Set<String> ruleIds) voidsetDoResetCheck(boolean resetCheck) set all paragraphs to be checked after every change of textvoidsetEnabledCategoryNames(Set<String> categoryNames) voidsetEnabledRuleIds(Set<String> ruleIds) voidvoidsetFontName(String fontName) Sets the name of the GUI's editing textarea font.voidsetFontSize(int fontSize) Sets the size of the GUI's editing textarea font.voidsetFontStyle(int fontStyle) Sets the style of the GUI's editing textarea font.voidsetFullCheckAtFirst(boolean doFullCheckAtFirst) set option to do a full check at first iterationvoidsetLanguage(org.languagetool.Language language) voidsetLookAndFeelName(String lookAndFeelName) Sets the name of the GUI's LaF.voidsetMotherTongue(org.languagetool.Language motherTongue) voidsetMultiThreadLO(boolean isMultiThread) run LO in multi thread modevoidsetNgramDirectory(File dir) Sets the directory with ngram data (may be null).voidsetNoMultiReset(boolean noMultiReset) set all paragraphs to be not checked after every change of text if more than one document loaded?voidsetNumParasToCheck(int numParas) set the number of paragraphs to be checked for TextLevelRulesvoidsetOtherServerUrl(String otherServerUrl) voidsetRemoteCheck(boolean doRemoteCheck) voidsetRunServer(boolean runServer) voidsetServerPort(int serverPort) voidsetSwitchedOff(boolean switchOff, org.languagetool.Language lang) voidsetTaggerShowsDisambigLog(boolean taggerShowsDisambigLog) Enables or disables the disambiguation log on the tagger window, depending on the value of the parameter taggerShowsDisambigLog.voidsetUnderlineColor(String category, Color col) voidsetUseDocLanguage(boolean useDocLang) voidsetUseGUIConfig(boolean useGUIConfig) voidsetUseOtherServer(boolean useOtherServer) voidsetWord2VecDirectory(File dir) Sets the directory with word2vec data (may be null).boolean
-
Constructor Details
-
Configuration
Uses the configuration file from the default location.- Parameters:
lang- The language for the configuration, used to distinguish rules that are enabled or disabled per language.- Throws:
IOException
-
Configuration
- Throws:
IOException
-
Configuration
public Configuration(File baseDir, String filename, org.languagetool.Language lang) throws IOException - Throws:
IOException
-
Configuration
public Configuration(File baseDir, String filename, org.languagetool.Language lang, org.languagetool.LinguServices linguServices) throws IOException - Throws:
IOException
-
Configuration
public Configuration(File baseDir, String filename, File oldConfigFile, org.languagetool.Language lang, org.languagetool.LinguServices linguServices) throws IOException - Throws:
IOException
-
-
Method Details
-
initOptions
public void initOptions()Initialize variables and clears Maps, Sets and Lists -
getDisabledRuleIds
-
getEnabledRuleIds
-
getDisabledCategoryNames
-
getEnabledCategoryNames
-
setDisabledRuleIds
-
addDisabledRuleIds
-
removeDisabledRuleIds
-
setEnabledRuleIds
-
setDisabledCategoryNames
-
setEnabledCategoryNames
-
getEnabledRulesOnly
public boolean getEnabledRulesOnly() -
getLanguage
public org.languagetool.Language getLanguage() -
setLanguage
public void setLanguage(org.languagetool.Language language) -
getMotherTongue
public org.languagetool.Language getMotherTongue() -
setMotherTongue
public void setMotherTongue(org.languagetool.Language motherTongue) -
getDefaultLanguage
public org.languagetool.Language getDefaultLanguage() -
setUseDocLanguage
public void setUseDocLanguage(boolean useDocLang) -
getUseDocLanguage
public boolean getUseDocLanguage() -
getAutoDetect
public boolean getAutoDetect() -
setAutoDetect
public void setAutoDetect(boolean autoDetect) -
setRemoteCheck
public void setRemoteCheck(boolean doRemoteCheck) -
doRemoteCheck
public boolean doRemoteCheck() -
setUseOtherServer
public void setUseOtherServer(boolean useOtherServer) -
useOtherServer
public boolean useOtherServer() -
setOtherServerUrl
-
getServerUrl
-
getTaggerShowsDisambigLog
public boolean getTaggerShowsDisambigLog()Determines whether the tagger window will also print the disambiguation log.- Returns:
- true if the tagger window will print the disambiguation log, false otherwise
- Since:
- 3.3
-
setTaggerShowsDisambigLog
public void setTaggerShowsDisambigLog(boolean taggerShowsDisambigLog) Enables or disables the disambiguation log on the tagger window, depending on the value of the parameter taggerShowsDisambigLog.- Parameters:
taggerShowsDisambigLog- If true, the tagger window will print the- Since:
- 3.3
-
getRunServer
public boolean getRunServer() -
setRunServer
public void setRunServer(boolean runServer) -
getServerPort
public int getServerPort() -
setUseGUIConfig
public void setUseGUIConfig(boolean useGUIConfig) -
getUseGUIConfig
public boolean getUseGUIConfig() -
setServerPort
public void setServerPort(int serverPort) -
getExternalRuleDirectory
-
setExternalRuleDirectory
-
getNumParasToCheck
public int getNumParasToCheck()get the number of paragraphs to be checked for TextLevelRules- Since:
- 4.0
-
setNumParasToCheck
public void setNumParasToCheck(int numParas) set the number of paragraphs to be checked for TextLevelRules- Since:
- 4.0
-
isResetCheck
public boolean isResetCheck()will all paragraphs check after every change of text?- Since:
- 4.2
-
setDoResetCheck
public void setDoResetCheck(boolean resetCheck) set all paragraphs to be checked after every change of text- Since:
- 4.2
-
isNoMultiReset
public boolean isNoMultiReset()will all paragraphs not checked after every change of text if more than one document loaded?- Since:
- 4.5
-
setNoMultiReset
public void setNoMultiReset(boolean noMultiReset) set all paragraphs to be not checked after every change of text if more than one document loaded?- Since:
- 4.5
-
setFullCheckAtFirst
public void setFullCheckAtFirst(boolean doFullCheckAtFirst) set option to do a full check at first iteration- Since:
- 4.7
-
doFullCheckAtFirst
public boolean doFullCheckAtFirst()do a full check at first iteration?- Since:
- 4.7
-
getCurrentProfile
-
setCurrentProfile
-
getDefinedProfiles
-
addProfile
-
addProfiles
-
removeProfile
-
setMultiThreadLO
public void setMultiThreadLO(boolean isMultiThread) run LO in multi thread mode- Since:
- 4.6
-
isMultiThread
public boolean isMultiThread()shall LO run in multi thread mode- Since:
- 4.6
-
getFontName
Returns the name of the GUI's editing textarea font.- Returns:
- the name of the font.
- Since:
- 2.6
- See Also:
-
setFontName
Sets the name of the GUI's editing textarea font.- Parameters:
fontName- the name of the font.- Since:
- 2.6
- See Also:
-
getFontStyle
public int getFontStyle()Returns the style of the GUI's editing textarea font.- Returns:
- the style of the font.
- Since:
- 2.6
- See Also:
-
setFontStyle
public void setFontStyle(int fontStyle) Sets the style of the GUI's editing textarea font.- Parameters:
fontStyle- the style of the font.- Since:
- 2.6
- See Also:
-
getFontSize
public int getFontSize()Returns the size of the GUI's editing textarea font.- Returns:
- the size of the font.
- Since:
- 2.6
- See Also:
-
setFontSize
public void setFontSize(int fontSize) Sets the size of the GUI's editing textarea font.- Parameters:
fontSize- the size of the font.- Since:
- 2.6
- See Also:
-
getLookAndFeelName
Returns the name of the GUI's LaF.- Returns:
- the name of the LaF.
- Since:
- 2.6
- See Also:
-
setLookAndFeelName
Sets the name of the GUI's LaF.- Parameters:
lookAndFeelName- the name of the LaF.- Since:
- 2.6 @see
- See Also:
-
getNgramDirectory
-
setNgramDirectory
Sets the directory with ngram data (may be null).- Since:
- 3.0
-
getWord2VecDirectory
Directory with word2vec data or null.- Since:
- 4.0
-
setWord2VecDirectory
Sets the directory with word2vec data (may be null).- Since:
- 4.0
-
getErrorColors
-
isStyleCategory
- Since:
- 4.3 Returns true if category is style like
-
initStyleCategories
- Since:
- 4.4 Initialize set of style like categories
-
isSpecialTabCategory
- Since:
- 4.3 Returns true if category is a special Tab category
-
isInSpecialTab
-
getSpecialTabNames
- Since:
- 4.3 Returns all special tab names
-
getSpecialTabCategories
-
getUnderlineColors
-
getUnderlineColor
-
setUnderlineColor
-
setDefaultUnderlineColor
- Since:
- 4.2 Set the color back to default (removes category from map)
-
getConfigurableValues
-
getConfigurableValue
- Since:
- 4.2 Get the configurable value of a rule by ruleID returns -1 if no value is set by configuration
-
setConfigurableValue
- Since:
- 4.2 Set the value for a rule with ruleID
-
isSwitchedOff
public boolean isSwitchedOff()- Since:
- 4.4 if true: LT is switched Off, else: LT is switched On
-
setSwitchedOff
- Throws:
IOException- Since:
- 4.4 Set LT is switched Off or On save configuration
-
loadConfiguration
- Throws:
IOException
-
saveConfiguration
- Throws:
IOException
-