useQuerySettings = enabledRules.length > 0 || disabledRules.length > 0;
final List<RuleMatch> matches;
final String sourceText = parameters.get("srctext");
if (sourceText == null) {
final JLanguageTool lt = getLanguageToolInstance(lang, motherTongue);
matches = lt.check(text);
} else {
if (motherTongueParam == null) {
throw new IllegalArgumentException("Missing 'motherTongue' for bilingual checks");
}
print("Checking bilingual text, with source length " + sourceText.length() +
" and target length " + text.length() + " (characters), source language " +
motherTongue + " and target language " + langParam);
final JLanguageTool sourceLt = getLanguageToolInstance(motherTongue, null);
final JLanguageTool targetLt = getLanguageToolInstance(lang, null);
final List<BitextRule> bRules = Tools.getBitextRules(motherTongue, lang);
matches = Tools.checkBitext(sourceText, text, sourceLt, targetLt, bRules);
}
setCommonHeaders(httpExchange);
final String response = StringTools.ruleMatchesToXML(matches, text,