Package org.languagetool.commandline
Class Main
java.lang.Object
org.languagetool.commandline.Main
The command line tool to check plain text files.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate boolean
private List
<org.languagetool.rules.bitext.BitextRule> private org.languagetool.rules.Rule
private org.languagetool.MultiThreadedJLanguageTool
private final CommandLineOptions
private boolean
private org.languagetool.MultiThreadedJLanguageTool
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate void
addExternalRules
(String filename) private void
changeLanguage
(org.languagetool.Language language, org.languagetool.Language motherTongue, List<String> disabledRules, List<String> enabledRules) private void
cleanUp()
private org.languagetool.Language
detectLanguageOfString
(String text) private String
getFilteredText
(String filename, String encoding, boolean xmlFiltering) Loads filename and filters out XML.private InputStreamReader
getInputStreamReader
(String filename, String encoding) (package private) org.languagetool.JLanguageTool
private void
handleLine
(org.languagetool.tools.StringTools.ApiPrintMode mode, int lineOffset, StringBuilder sb) private boolean
isBreakPoint
(String line) (package private) boolean
private boolean
static void
Command line tool to check plain text files.private static void
private void
private void
runOnFileLineByLine
(String filename, String encoding) private void
runRecursive
(String filename, String encoding, boolean xmlFiltering) private void
setBitextMode
(org.languagetool.Language sourceLang, List<String> disabledRules, List<String> enabledRules, File bitextRuleFile) private void
setListUnknownWords
(boolean listUnknownWords) private void
-
Field Details
-
options
-
lt
private org.languagetool.MultiThreadedJLanguageTool lt -
profileRules
private boolean profileRules -
bitextMode
private boolean bitextMode -
srcLt
private org.languagetool.MultiThreadedJLanguageTool srcLt -
bRules
-
currentRule
private org.languagetool.rules.Rule currentRule
-
-
Constructor Details
-
Main
Main(CommandLineOptions options) throws IOException - Throws:
IOException
-
-
Method Details
-
addExternalRules
- Throws:
IOException
-
isSpellCheckingActive
boolean isSpellCheckingActive() -
getJLanguageTool
org.languagetool.JLanguageTool getJLanguageTool() -
setListUnknownWords
private void setListUnknownWords(boolean listUnknownWords) -
cleanUp
private void cleanUp() -
setProfilingMode
private void setProfilingMode() -
setBitextMode
private void setBitextMode(org.languagetool.Language sourceLang, List<String> disabledRules, List<String> enabledRules, File bitextRuleFile) throws IOException, ParserConfigurationException, SAXException -
runOnFile
- Throws:
IOException
-
runOnFileLineByLine
- Throws:
IOException
-
handleLine
private void handleLine(org.languagetool.tools.StringTools.ApiPrintMode mode, int lineOffset, StringBuilder sb) throws IOException - Throws:
IOException
-
isBreakPoint
-
getInputStreamReader
- Throws:
IOException
-
isStdIn
-
runRecursive
-
getFilteredText
private String getFilteredText(String filename, String encoding, boolean xmlFiltering) throws IOException Loads filename and filters out XML. Note that the XML filtering can lead to incorrect positions in the list of matching rules.- Throws:
IOException
-
changeLanguage
-
main
public static void main(String[] args) throws IOException, ParserConfigurationException, SAXException Command line tool to check plain text files. -
printLanguages
private static void printLanguages() -
detectLanguageOfString
-