Package org.languagetool.gui
Class Configuration
- java.lang.Object
-
- org.languagetool.gui.Configuration
-
public class Configuration extends java.lang.ObjectConfiguration like list of disabled rule IDs, server mode etc. Configuration is loaded from and stored to a properties file.
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<java.lang.String>allProfileKeysprivate java.util.List<java.lang.String>allProfileLangKeysprivate static java.lang.StringAUTO_DETECT_KEYprivate booleanautoDetectprivate static java.lang.StringBLANKprivate static java.lang.StringBLANK_REPLACEprivate static java.lang.StringCOLOR_SPLITTER_REGEXPprivate static java.lang.StringCOLOR_SPLITTER_REGEXP_COLONprivate static java.lang.StringCONFIG_FILEprivate java.io.FileconfigFileprivate java.util.Map<java.lang.String,java.lang.String>configForOtherLanguagesprivate java.util.Map<java.lang.String,java.lang.String>configForOtherProfilesprivate static java.lang.StringCONFIGURABLE_RULE_SPLITTER_REGEXPprivate static java.lang.StringCONFIGURABLE_RULE_VALUES_KEYprivate java.util.Map<java.lang.String,java.lang.Integer>configurableRuleValuesprivate static java.lang.StringCURRENT_PROFILE_KEYprivate java.lang.StringcurrentProfile(package private) static intDEFAULT_NUM_CHECK_PARAS(package private) static intDEFAULT_SERVER_PORTprivate static java.lang.StringDEFINED_PROFILES_KEYprivate java.util.List<java.lang.String>definedProfilesprivate static java.lang.StringDELIMITERprivate static java.lang.StringDISABLED_CATEGORIES_KEYprivate static java.lang.StringDISABLED_RULES_KEYprivate java.util.Set<java.lang.String>disabledCategoryNamesprivate java.util.Set<java.lang.String>disabledRuleIdsprivate static java.lang.StringDO_FULL_CHECK_AT_FIRST_KEYprivate static java.lang.StringDO_REMOTE_CHECK_KEYprivate booleandoFullCheckAtFirstprivate booleandoRemoteCheckprivate booleandoResetCheckprivate static java.lang.StringENABLED_CATEGORIES_KEYprivate static java.lang.StringENABLED_RULES_KEYprivate static java.lang.StringENABLED_RULES_ONLY_KEYprivate java.util.Set<java.lang.String>enabledCategoryNamesprivate java.util.Set<java.lang.String>enabledRuleIdsprivate booleanenabledRulesOnlyprivate static java.lang.StringERROR_COLORS_KEYprivate java.util.Map<org.languagetool.rules.ITSIssueType,java.awt.Color>errorColorsprivate static java.lang.StringEXTERNAL_RULE_DIRECTORYprivate java.lang.StringexternalRuleDirectoryprivate static java.lang.StringFONT_NAME_KEY(package private) static intFONT_SIZE_INVALIDprivate static java.lang.StringFONT_SIZE_KEY(package private) static intFONT_STYLE_INVALIDprivate static java.lang.StringFONT_STYLE_KEYprivate java.lang.StringfontNameprivate intfontSizeprivate intfontStyleprivate booleanguiConfigprivate static java.lang.StringIS_MULTI_THREAD_LO_KEYprivate booleanisMultiThreadLOprivate org.languagetool.Languagelangprivate org.languagetool.Languagelanguageprivate static java.lang.StringLANGUAGE_KEYprivate static java.lang.StringLF_NAME_KEYprivate java.lang.StringlookAndFeelNameprivate static java.lang.StringLT_SWITCHED_OFF_KEYprivate static java.lang.StringMOTHER_TONGUE_KEYprivate org.languagetool.LanguagemotherTongueprivate static java.lang.StringNGRAM_DIR_KEYprivate java.io.FilengramDirectoryprivate static java.lang.StringNO_MULTI_RESET_KEYprivate booleannoMultiResetprivate intnumParasToCheckprivate java.io.FileoldConfigFileprivate static java.lang.StringOTHER_SERVER_URL_KEYprivate java.lang.StringotherServerUrlprivate static java.lang.StringPARA_CHECK_KEYprivate static java.lang.StringPROFILE_DELIMITERprivate static java.lang.StringRESET_CHECK_KEYprivate booleanrunServerprivate static java.lang.StringSERVER_PORT_KEYprivate static java.lang.StringSERVER_RUN_KEYprivate intserverPortprivate java.util.Map<java.lang.String,java.lang.String>specialTabCategories(package private) static java.awt.ColorSTYLE_COLORprivate java.util.Set<java.lang.String>styleLikeCategoriesprivate booleanswitchOffprivate static java.lang.StringTAGGER_SHOWS_DISAMBIG_LOG_KEYprivate booleantaggerShowsDisambigLogprivate static java.lang.StringUNDERLINE_COLORS_KEYprivate java.util.Map<java.lang.String,java.awt.Color>underlineColorsprivate static java.lang.StringUSE_DOC_LANG_KEYprivate static java.lang.StringUSE_GUI_KEYprivate static java.lang.StringUSE_OTHER_SERVER_KEYprivate booleanuseDocLanguageprivate booleanuseOtherServerprivate static java.lang.StringWORD2VEC_DIR_KEYprivate java.io.Fileword2vecDirectory
-
Constructor Summary
Constructors Modifier Constructor Description privateConfiguration()Configuration(java.io.File baseDir, java.lang.String filename, java.io.File oldConfigFile, org.languagetool.Language lang, org.languagetool.LinguServices linguServices)Configuration(java.io.File baseDir, java.lang.String filename, org.languagetool.Language lang)Configuration(java.io.File baseDir, java.lang.String filename, org.languagetool.Language lang, org.languagetool.LinguServices linguServices)Configuration(java.io.File baseDir, org.languagetool.Language lang)Configuration(org.languagetool.Language lang)Uses the configuration file from the default location.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddDisabledRuleIds(java.util.Set<java.lang.String> ruleIds)private voidaddListToProperties(java.util.Properties props, java.lang.String key, java.util.Set<java.lang.String> list)voidaddProfile(java.lang.String profile)add a new profilevoidaddProfiles(java.util.List<java.lang.String> profiles)add a list of profiles(package private) Configurationcopy(Configuration configuration)Returns a copy of the given configuration.booleandoFullCheckAtFirst()do a full check at first iteration?booleandoRemoteCheck()booleangetAutoDetect()intgetConfigurableValue(java.lang.String ruleID)java.util.Map<java.lang.String,java.lang.Integer>getConfigurableValues()returns all configured valuesjava.lang.StringgetCurrentProfile()get the current profileorg.languagetool.LanguagegetDefaultLanguage()java.util.List<java.lang.String>getDefinedProfiles()get the current profilejava.util.Set<java.lang.String>getDisabledCategoryNames()java.util.Set<java.lang.String>getDisabledRuleIds()java.util.Set<java.lang.String>getEnabledCategoryNames()java.util.Set<java.lang.String>getEnabledRuleIds()booleangetEnabledRulesOnly()java.util.Map<org.languagetool.rules.ITSIssueType,java.awt.Color>getErrorColors()java.lang.StringgetExternalRuleDirectory()java.lang.StringgetFontName()Returns the name of the GUI's editing textarea font.intgetFontSize()Returns the size of the GUI's editing textarea font.intgetFontStyle()Returns the style of the GUI's editing textarea font.org.languagetool.LanguagegetLanguage()private java.util.Collection<? extends java.lang.String>getListFromProperties(java.util.Properties props, java.lang.String key)java.lang.StringgetLookAndFeelName()Returns the name of the GUI's LaF.org.languagetool.LanguagegetMotherTongue()@Nullable java.io.FilegetNgramDirectory()Directory with ngram data or null.intgetNumParasToCheck()get the number of paragraphs to be checked for TextLevelRulesprivate java.lang.StringgetQualifier(org.languagetool.Language lang)booleangetRunServer()intgetServerPort()java.lang.StringgetServerUrl()java.util.Set<java.lang.String>getSpecialTabCategories(java.lang.String tabName)java.lang.String[]getSpecialTabNames()booleangetTaggerShowsDisambigLog()Determines whether the tagger window will also print the disambiguation log.java.awt.ColorgetUnderlineColor(java.lang.String category)java.util.Map<java.lang.String,java.awt.Color>getUnderlineColors()booleangetUseDocLanguage()booleangetUseGUIConfig()@Nullable java.io.FilegetWord2VecDirectory()Directory with word2vec data or null.voidinitOptions()Initialize variables and clears Maps, Sets and ListsvoidinitStyleCategories(java.util.List<org.languagetool.rules.Rule> allRules)booleanisInSpecialTab(java.lang.String category, java.lang.String tabName)booleanisMultiThread()shall LO run in multi thread modebooleanisNoMultiReset()will all paragraphs not checked after every change of text if more than one document loaded?booleanisResetCheck()will all paragraphs check after every change of text?booleanisSpecialTabCategory(java.lang.String category)booleanisStyleCategory(java.lang.String category)booleanisSwitchedOff()private voidloadConfigForOtherLanguages(org.languagetool.Language lang, java.util.Properties prop, java.lang.String prefix)private voidloadConfiguration()voidloadConfiguration(java.lang.String profile)private voidparseConfigurableRuleValues(java.lang.String rulesValueString)private voidparseErrorColors(java.lang.String colorsString)private voidparseUnderlineColors(java.lang.String colorsString)voidremoveDisabledRuleIds(java.util.Set<java.lang.String> ruleIds)voidremoveProfile(java.lang.String profile)remove an existing profile(package private) voidrestoreState(Configuration configuration)Restore the state of this object from configuration.private voidsaveConfigforProfile(java.util.Properties props, java.lang.String prefix)voidsaveConfiguration(org.languagetool.Language lang)private voidsetAllProfileKeys()voidsetAutoDetect(boolean autoDetect)voidsetConfigurableValue(java.lang.String ruleID, int value)voidsetCurrentProfile(java.lang.String profile)set the current profilevoidsetDefaultUnderlineColor(java.lang.String category)voidsetDisabledCategoryNames(java.util.Set<java.lang.String> categoryNames)voidsetDisabledRuleIds(java.util.Set<java.lang.String> ruleIds)voidsetDoResetCheck(boolean resetCheck)set all paragraphs to be checked after every change of textvoidsetEnabledCategoryNames(java.util.Set<java.lang.String> categoryNames)voidsetEnabledRuleIds(java.util.Set<java.lang.String> ruleIds)voidsetExternalRuleDirectory(java.lang.String path)voidsetFontName(java.lang.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(java.lang.String lookAndFeelName)Sets the name of the GUI's LaF.voidsetMotherTongue(org.languagetool.Language motherTongue)voidsetMultiThreadLO(boolean isMultiThread)run LO in multi thread modevoidsetNgramDirectory(java.io.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(java.lang.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(java.lang.String category, java.awt.Color col)voidsetUseDocLanguage(boolean useDocLang)voidsetUseGUIConfig(boolean useGUIConfig)voidsetUseOtherServer(boolean useOtherServer)voidsetWord2VecDirectory(java.io.File dir)Sets the directory with word2vec data (may be null).private voidstoreConfigforAllProfiles(java.util.Properties props)private voidstoreConfigKeyFromProp(java.util.Properties prop, java.lang.String key)booleanuseOtherServer()
-
-
-
Field Detail
-
DEFAULT_SERVER_PORT
static final int DEFAULT_SERVER_PORT
- See Also:
- Constant Field Values
-
DEFAULT_NUM_CHECK_PARAS
static final int DEFAULT_NUM_CHECK_PARAS
- See Also:
- Constant Field Values
-
FONT_STYLE_INVALID
static final int FONT_STYLE_INVALID
- See Also:
- Constant Field Values
-
FONT_SIZE_INVALID
static final int FONT_SIZE_INVALID
- See Also:
- Constant Field Values
-
STYLE_COLOR
static final java.awt.Color STYLE_COLOR
-
CONFIG_FILE
private static final java.lang.String CONFIG_FILE
- See Also:
- Constant Field Values
-
CURRENT_PROFILE_KEY
private static final java.lang.String CURRENT_PROFILE_KEY
- See Also:
- Constant Field Values
-
DEFINED_PROFILES_KEY
private static final java.lang.String DEFINED_PROFILES_KEY
- See Also:
- Constant Field Values
-
DISABLED_RULES_KEY
private static final java.lang.String DISABLED_RULES_KEY
- See Also:
- Constant Field Values
-
ENABLED_RULES_KEY
private static final java.lang.String ENABLED_RULES_KEY
- See Also:
- Constant Field Values
-
DISABLED_CATEGORIES_KEY
private static final java.lang.String DISABLED_CATEGORIES_KEY
- See Also:
- Constant Field Values
-
ENABLED_CATEGORIES_KEY
private static final java.lang.String ENABLED_CATEGORIES_KEY
- See Also:
- Constant Field Values
-
ENABLED_RULES_ONLY_KEY
private static final java.lang.String ENABLED_RULES_ONLY_KEY
- See Also:
- Constant Field Values
-
LANGUAGE_KEY
private static final java.lang.String LANGUAGE_KEY
- See Also:
- Constant Field Values
-
MOTHER_TONGUE_KEY
private static final java.lang.String MOTHER_TONGUE_KEY
- See Also:
- Constant Field Values
-
NGRAM_DIR_KEY
private static final java.lang.String NGRAM_DIR_KEY
- See Also:
- Constant Field Values
-
WORD2VEC_DIR_KEY
private static final java.lang.String WORD2VEC_DIR_KEY
- See Also:
- Constant Field Values
-
AUTO_DETECT_KEY
private static final java.lang.String AUTO_DETECT_KEY
- See Also:
- Constant Field Values
-
TAGGER_SHOWS_DISAMBIG_LOG_KEY
private static final java.lang.String TAGGER_SHOWS_DISAMBIG_LOG_KEY
- See Also:
- Constant Field Values
-
SERVER_RUN_KEY
private static final java.lang.String SERVER_RUN_KEY
- See Also:
- Constant Field Values
-
SERVER_PORT_KEY
private static final java.lang.String SERVER_PORT_KEY
- See Also:
- Constant Field Values
-
PARA_CHECK_KEY
private static final java.lang.String PARA_CHECK_KEY
- See Also:
- Constant Field Values
-
RESET_CHECK_KEY
private static final java.lang.String RESET_CHECK_KEY
- See Also:
- Constant Field Values
-
NO_MULTI_RESET_KEY
private static final java.lang.String NO_MULTI_RESET_KEY
- See Also:
- Constant Field Values
-
DO_FULL_CHECK_AT_FIRST_KEY
private static final java.lang.String DO_FULL_CHECK_AT_FIRST_KEY
- See Also:
- Constant Field Values
-
USE_DOC_LANG_KEY
private static final java.lang.String USE_DOC_LANG_KEY
- See Also:
- Constant Field Values
-
USE_GUI_KEY
private static final java.lang.String USE_GUI_KEY
- See Also:
- Constant Field Values
-
FONT_NAME_KEY
private static final java.lang.String FONT_NAME_KEY
- See Also:
- Constant Field Values
-
FONT_STYLE_KEY
private static final java.lang.String FONT_STYLE_KEY
- See Also:
- Constant Field Values
-
FONT_SIZE_KEY
private static final java.lang.String FONT_SIZE_KEY
- See Also:
- Constant Field Values
-
LF_NAME_KEY
private static final java.lang.String LF_NAME_KEY
- See Also:
- Constant Field Values
-
ERROR_COLORS_KEY
private static final java.lang.String ERROR_COLORS_KEY
- See Also:
- Constant Field Values
-
UNDERLINE_COLORS_KEY
private static final java.lang.String UNDERLINE_COLORS_KEY
- See Also:
- Constant Field Values
-
CONFIGURABLE_RULE_VALUES_KEY
private static final java.lang.String CONFIGURABLE_RULE_VALUES_KEY
- See Also:
- Constant Field Values
-
LT_SWITCHED_OFF_KEY
private static final java.lang.String LT_SWITCHED_OFF_KEY
- See Also:
- Constant Field Values
-
IS_MULTI_THREAD_LO_KEY
private static final java.lang.String IS_MULTI_THREAD_LO_KEY
- See Also:
- Constant Field Values
-
EXTERNAL_RULE_DIRECTORY
private static final java.lang.String EXTERNAL_RULE_DIRECTORY
- See Also:
- Constant Field Values
-
DO_REMOTE_CHECK_KEY
private static final java.lang.String DO_REMOTE_CHECK_KEY
- See Also:
- Constant Field Values
-
OTHER_SERVER_URL_KEY
private static final java.lang.String OTHER_SERVER_URL_KEY
- See Also:
- Constant Field Values
-
USE_OTHER_SERVER_KEY
private static final java.lang.String USE_OTHER_SERVER_KEY
- See Also:
- Constant Field Values
-
DELIMITER
private static final java.lang.String DELIMITER
- See Also:
- Constant Field Values
-
COLOR_SPLITTER_REGEXP
private static final java.lang.String COLOR_SPLITTER_REGEXP
- See Also:
- Constant Field Values
-
COLOR_SPLITTER_REGEXP_COLON
private static final java.lang.String COLOR_SPLITTER_REGEXP_COLON
- See Also:
- Constant Field Values
-
CONFIGURABLE_RULE_SPLITTER_REGEXP
private static final java.lang.String CONFIGURABLE_RULE_SPLITTER_REGEXP
- See Also:
- Constant Field Values
-
BLANK
private static final java.lang.String BLANK
- See Also:
- Constant Field Values
-
BLANK_REPLACE
private static final java.lang.String BLANK_REPLACE
- See Also:
- Constant Field Values
-
PROFILE_DELIMITER
private static final java.lang.String PROFILE_DELIMITER
- See Also:
- Constant Field Values
-
configForOtherProfiles
private final java.util.Map<java.lang.String,java.lang.String> configForOtherProfiles
-
configForOtherLanguages
private final java.util.Map<java.lang.String,java.lang.String> configForOtherLanguages
-
errorColors
private final java.util.Map<org.languagetool.rules.ITSIssueType,java.awt.Color> errorColors
-
underlineColors
private final java.util.Map<java.lang.String,java.awt.Color> underlineColors
-
configurableRuleValues
private final java.util.Map<java.lang.String,java.lang.Integer> configurableRuleValues
-
styleLikeCategories
private final java.util.Set<java.lang.String> styleLikeCategories
-
specialTabCategories
private final java.util.Map<java.lang.String,java.lang.String> specialTabCategories
-
disabledRuleIds
private java.util.Set<java.lang.String> disabledRuleIds
-
enabledRuleIds
private java.util.Set<java.lang.String> enabledRuleIds
-
disabledCategoryNames
private java.util.Set<java.lang.String> disabledCategoryNames
-
enabledCategoryNames
private java.util.Set<java.lang.String> enabledCategoryNames
-
definedProfiles
private java.util.List<java.lang.String> definedProfiles
-
allProfileKeys
private java.util.List<java.lang.String> allProfileKeys
-
allProfileLangKeys
private java.util.List<java.lang.String> allProfileLangKeys
-
lang
private org.languagetool.Language lang
-
configFile
private java.io.File configFile
-
oldConfigFile
private java.io.File oldConfigFile
-
enabledRulesOnly
private boolean enabledRulesOnly
-
language
private org.languagetool.Language language
-
motherTongue
private org.languagetool.Language motherTongue
-
ngramDirectory
private java.io.File ngramDirectory
-
word2vecDirectory
private java.io.File word2vecDirectory
-
runServer
private boolean runServer
-
autoDetect
private boolean autoDetect
-
taggerShowsDisambigLog
private boolean taggerShowsDisambigLog
-
guiConfig
private boolean guiConfig
-
fontName
private java.lang.String fontName
-
fontStyle
private int fontStyle
-
fontSize
private int fontSize
-
serverPort
private int serverPort
-
numParasToCheck
private int numParasToCheck
-
doResetCheck
private boolean doResetCheck
-
noMultiReset
private boolean noMultiReset
-
doFullCheckAtFirst
private boolean doFullCheckAtFirst
-
externalRuleDirectory
private java.lang.String externalRuleDirectory
-
lookAndFeelName
private java.lang.String lookAndFeelName
-
switchOff
private boolean switchOff
-
useDocLanguage
private boolean useDocLanguage
-
isMultiThreadLO
private boolean isMultiThreadLO
-
currentProfile
private java.lang.String currentProfile
-
doRemoteCheck
private boolean doRemoteCheck
-
useOtherServer
private boolean useOtherServer
-
otherServerUrl
private java.lang.String otherServerUrl
-
-
Constructor Detail
-
Configuration
public Configuration(org.languagetool.Language lang) throws java.io.IOExceptionUses 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:
java.io.IOException
-
Configuration
public Configuration(java.io.File baseDir, org.languagetool.Language lang) throws java.io.IOException- Throws:
java.io.IOException
-
Configuration
public Configuration(java.io.File baseDir, java.lang.String filename, org.languagetool.Language lang) throws java.io.IOException- Throws:
java.io.IOException
-
Configuration
public Configuration(java.io.File baseDir, java.lang.String filename, org.languagetool.Language lang, org.languagetool.LinguServices linguServices) throws java.io.IOException- Throws:
java.io.IOException
-
Configuration
public Configuration(java.io.File baseDir, java.lang.String filename, java.io.File oldConfigFile, org.languagetool.Language lang, org.languagetool.LinguServices linguServices) throws java.io.IOException- Throws:
java.io.IOException
-
Configuration
private Configuration()
-
-
Method Detail
-
initOptions
public void initOptions()
Initialize variables and clears Maps, Sets and Lists
-
copy
Configuration copy(Configuration configuration)
Returns a copy of the given configuration.- Parameters:
configuration- the object to copy.- Since:
- 2.6
-
restoreState
void restoreState(Configuration configuration)
Restore the state of this object from configuration.- Parameters:
configuration- the object from which we will read the state- Since:
- 2.6
-
getDisabledRuleIds
public java.util.Set<java.lang.String> getDisabledRuleIds()
-
getEnabledRuleIds
public java.util.Set<java.lang.String> getEnabledRuleIds()
-
getDisabledCategoryNames
public java.util.Set<java.lang.String> getDisabledCategoryNames()
-
getEnabledCategoryNames
public java.util.Set<java.lang.String> getEnabledCategoryNames()
-
setDisabledRuleIds
public void setDisabledRuleIds(java.util.Set<java.lang.String> ruleIds)
-
addDisabledRuleIds
public void addDisabledRuleIds(java.util.Set<java.lang.String> ruleIds)
-
removeDisabledRuleIds
public void removeDisabledRuleIds(java.util.Set<java.lang.String> ruleIds)
-
setEnabledRuleIds
public void setEnabledRuleIds(java.util.Set<java.lang.String> ruleIds)
-
setDisabledCategoryNames
public void setDisabledCategoryNames(java.util.Set<java.lang.String> categoryNames)
-
setEnabledCategoryNames
public void setEnabledCategoryNames(java.util.Set<java.lang.String> categoryNames)
-
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
public void setOtherServerUrl(java.lang.String otherServerUrl)
-
getServerUrl
public java.lang.String 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
public java.lang.String getExternalRuleDirectory()
-
setExternalRuleDirectory
public void setExternalRuleDirectory(java.lang.String path)
-
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
public java.lang.String getCurrentProfile()
get the current profile- Since:
- 4.7
-
setCurrentProfile
public void setCurrentProfile(java.lang.String profile)
set the current profile- Since:
- 4.7
-
getDefinedProfiles
public java.util.List<java.lang.String> getDefinedProfiles()
get the current profile- Since:
- 4.7
-
addProfile
public void addProfile(java.lang.String profile)
add a new profile- Since:
- 4.7
-
addProfiles
public void addProfiles(java.util.List<java.lang.String> profiles)
add a list of profiles- Since:
- 4.7
-
removeProfile
public void removeProfile(java.lang.String profile)
remove an existing profile- Since:
- 4.7
-
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
public java.lang.String getFontName()
Returns the name of the GUI's editing textarea font.- Returns:
- the name of the font.
- Since:
- 2.6
- See Also:
Font.getFamily()
-
setFontName
public void setFontName(java.lang.String fontName)
Sets the name of the GUI's editing textarea font.- Parameters:
fontName- the name of the font.- Since:
- 2.6
- See Also:
Font.getFamily()
-
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:
Font.getStyle()
-
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:
Font.getStyle()
-
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:
Font.getSize()
-
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:
Font.getSize()
-
getLookAndFeelName
public java.lang.String getLookAndFeelName()
Returns the name of the GUI's LaF.- Returns:
- the name of the LaF.
- Since:
- 2.6
- See Also:
UIManager.LookAndFeelInfo.getName()
-
setLookAndFeelName
public void setLookAndFeelName(java.lang.String lookAndFeelName)
Sets the name of the GUI's LaF.- Parameters:
lookAndFeelName- the name of the LaF.- Since:
- 2.6 @see
- See Also:
UIManager.LookAndFeelInfo.getName()
-
getNgramDirectory
@Nullable public @Nullable java.io.File getNgramDirectory()
Directory with ngram data or null.- Since:
- 3.0
-
setNgramDirectory
public void setNgramDirectory(java.io.File dir)
Sets the directory with ngram data (may be null).- Since:
- 3.0
-
getWord2VecDirectory
@Nullable public @Nullable java.io.File getWord2VecDirectory()
Directory with word2vec data or null.- Since:
- 4.0
-
setWord2VecDirectory
public void setWord2VecDirectory(java.io.File dir)
Sets the directory with word2vec data (may be null).- Since:
- 4.0
-
getErrorColors
public java.util.Map<org.languagetool.rules.ITSIssueType,java.awt.Color> getErrorColors()
- Since:
- 2.8
-
isStyleCategory
public boolean isStyleCategory(java.lang.String category)
- Since:
- 4.3 Returns true if category is style like
-
initStyleCategories
public void initStyleCategories(java.util.List<org.languagetool.rules.Rule> allRules)
- Since:
- 4.4 Initialize set of style like categories
-
isSpecialTabCategory
public boolean isSpecialTabCategory(java.lang.String category)
- Since:
- 4.3 Returns true if category is a special Tab category
-
isInSpecialTab
public boolean isInSpecialTab(java.lang.String category, java.lang.String tabName)- Since:
- 4.3 Returns true if category is member of named special Tab
-
getSpecialTabNames
public java.lang.String[] getSpecialTabNames()
- Since:
- 4.3 Returns all special tab names
-
getSpecialTabCategories
public java.util.Set<java.lang.String> getSpecialTabCategories(java.lang.String tabName)
- Since:
- 4.3 Returns all categories for a named special tab
-
getUnderlineColors
public java.util.Map<java.lang.String,java.awt.Color> getUnderlineColors()
- Since:
- 4.2
-
getUnderlineColor
public java.awt.Color getUnderlineColor(java.lang.String category)
- Since:
- 4.2 Get the color to underline a rule match by the Name of its category
-
setUnderlineColor
public void setUnderlineColor(java.lang.String category, java.awt.Color col)- Since:
- 4.2 Set the color to underline a rule match for its category
-
setDefaultUnderlineColor
public void setDefaultUnderlineColor(java.lang.String category)
- Since:
- 4.2 Set the color back to default (removes category from map)
-
getConfigurableValues
public java.util.Map<java.lang.String,java.lang.Integer> getConfigurableValues()
returns all configured values- Since:
- 4.2
-
getConfigurableValue
public int getConfigurableValue(java.lang.String ruleID)
- Since:
- 4.2 Get the configurable value of a rule by ruleID returns -1 if no value is set by configuration
-
setConfigurableValue
public void setConfigurableValue(java.lang.String ruleID, int value)- 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
public void setSwitchedOff(boolean switchOff, org.languagetool.Language lang) throws java.io.IOException- Throws:
java.io.IOException- Since:
- 4.4 Set LT is switched Off or On save configuration
-
loadConfiguration
private void loadConfiguration() throws java.io.IOException- Throws:
java.io.IOException
-
loadConfiguration
public void loadConfiguration(java.lang.String profile) throws java.io.IOException- Throws:
java.io.IOException
-
parseErrorColors
private void parseErrorColors(java.lang.String colorsString)
-
parseUnderlineColors
private void parseUnderlineColors(java.lang.String colorsString)
-
parseConfigurableRuleValues
private void parseConfigurableRuleValues(java.lang.String rulesValueString)
-
getQualifier
private java.lang.String getQualifier(org.languagetool.Language lang)
-
loadConfigForOtherLanguages
private void loadConfigForOtherLanguages(org.languagetool.Language lang, java.util.Properties prop, java.lang.String prefix)
-
storeConfigKeyFromProp
private void storeConfigKeyFromProp(java.util.Properties prop, java.lang.String key)
-
getListFromProperties
private java.util.Collection<? extends java.lang.String> getListFromProperties(java.util.Properties props, java.lang.String key)
-
saveConfiguration
public void saveConfiguration(org.languagetool.Language lang) throws java.io.IOException- Throws:
java.io.IOException
-
addListToProperties
private void addListToProperties(java.util.Properties props, java.lang.String key, java.util.Set<java.lang.String> list)
-
setAllProfileKeys
private void setAllProfileKeys()
-
storeConfigforAllProfiles
private void storeConfigforAllProfiles(java.util.Properties props)
-
saveConfigforProfile
private void saveConfigforProfile(java.util.Properties props, java.lang.String prefix)
-
-