Class Main
java.lang.Object
org.languagetool.commandline.Main
The command line tool to check plain text files.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanprivate List<org.languagetool.rules.bitext.BitextRule> private org.languagetool.rules.Ruleprivate org.languagetool.MultiThreadedJLanguageToolprivate final CommandLineOptionsprivate booleanprivate org.languagetool.MultiThreadedJLanguageTool -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidaddExternalRules(String filename) private voidchangeLanguage(org.languagetool.Language language, org.languagetool.Language motherTongue, List<String> disabledRules, List<String> enabledRules) private voidcleanUp()private org.languagetool.LanguagedetectLanguageOfString(String text) private StringgetFilteredText(String filename, String encoding, boolean xmlFiltering) Loads filename and filters out XML.private InputStreamReadergetInputStreamReader(String filename, String encoding) (package private) org.languagetool.JLanguageToolprivate voidhandleLine(org.languagetool.tools.StringTools.ApiPrintMode mode, int lineOffset, StringBuilder sb) private booleanisBreakPoint(String line) (package private) booleanprivate booleanstatic voidCommand line tool to check plain text files.private static voidprivate voidprivate voidrunOnFileLineByLine(String filename, String encoding) private voidrunRecursive(String filename, String encoding, boolean xmlFiltering) private voidsetBitextMode(org.languagetool.Language sourceLang, List<String> disabledRules, List<String> enabledRules, File bitextRuleFile) private voidsetListUnknownWords(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
-