{"record":{"id":"e3122b0782d8cc78","repo":"languagetool-org/languagetool","slug":"json-output-format-is-not-implemented-for-bitext","errorCode":null,"errorMessage":"JSON output format is not implemented for Bitext","messagePattern":"JSON output format is not implemented for Bitext","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"languagetool-commandline/src/main/java/org/languagetool/commandline/CommandLineParser.java","lineNumber":145,"sourceCode":"        checkArguments(\"-c/--encoding\", i, args);\n        options.setEncoding(args[++i]);\n      } else if (args[i].equals(\"-u\") || args[i].equals(\"--list-unknown\")) {\n        options.setListUnknown(true);\n        if (options.isTaggerOnly()) {\n          throw new IllegalArgumentException(\"You cannot list unknown words when tagging only\");\n        }\n      } else if (args[i].equals(\"-b\")) {\n        options.setSingleLineBreakMarksParagraph(true);\n      } else if (args[i].equals(\"--json\")) {\n        options.setJsonFormat();\n        if (options.isApplySuggestions()) {\n          throw new IllegalArgumentException(\"JSON output format makes no sense for automatic application of suggestions\");\n        }\n        if (options.isLineByLine()) {\n          throw new IllegalArgumentException(\"JSON output format is not implemented for \\\"line by line\\\" analysis\");\n        }\n        if (options.isBitext()) {\n          throw new IllegalArgumentException(\"JSON output format is not implemented for Bitext\");\n        }\n        if (options.isListUnknown()) {\n          throw new IllegalArgumentException(\"You cannot list unknown words in JSON output format\");\n        }\n      } else if (args[i].equals(\"-a\") || args[i].equals(\"--apply\")) {\n        options.setApplySuggestions(true);\n        if (options.isTaggerOnly()) {\n          throw new IllegalArgumentException(\"You cannot apply suggestions when tagging only\");\n        }\n        if (options.isJsonFormat()) {\n          throw new IllegalArgumentException(\"JSON output format makes no sense for automatic application of suggestions\");\n        }\n      } else if (args[i].equals(\"-p\") || args[i].equals(\"--profile\")) {\n        options.setProfile(true);\n        if (options.isJsonFormat()) {\n          throw new IllegalArgumentException(\"JSON output format makes no sense for profiling\");\n        }\n        if (options.isApplySuggestions()) {","sourceCodeStart":127,"sourceCodeEnd":163,"githubUrl":"https://github.com/languagetool-org/languagetool/blob/2e990059ce67d5e2a0f7f7ca5d31160c6709df4b/languagetool-commandline/src/main/java/org/languagetool/commandline/CommandLineParser.java#L127-L163","documentation":"Guard inside CommandLineTools option parsing: the --json flag was accepted, but JSON output has never been implemented for bitext mode (checking a text against another language with --bitext/--mother-tongue). The offending input is the combination of --json with bitext options on the command line; the parser rejects it up front instead of producing unsupported output.","triggerScenarios":"`languagetool -b2 --json file.txt` — --bitext parsed before --json.","commonSituations":"Translation QA pipelines using bitext mode that also want structured JSON output; scripts appending --json for downstream tooling.","solutions":["Drop --json when running bitext mode and parse the default output.","Drop -b2/--bitext if the file is monolingual and JSON output is required.","Post-process the default bitext output into JSON yourself in the calling script."],"exampleFix":"// before\nlanguagetool -b2 --json -l en -l2 de file.txt\n// after\nlanguagetool -b2 -l en -l2 de file.txt","handlingStrategy":"validation","validationCode":"List<String> a = Arrays.asList(args);\nif (a.contains(\"--json\") && (a.contains(\"-b2\") || a.contains(\"--bitext\"))) {\n  throw new IllegalArgumentException(\"--json is incompatible with bitext mode\");\n}","typeGuard":null,"tryCatchPattern":"try {\n  new CommandLineParser().parseOptions(args);\n} catch (IllegalArgumentException e) {\n  if (e.getMessage().contains(\"not implemented for Bitext\")) {\n    System.err.println(\"Run bitext checks without --json, or convert the default output to JSON yourself.\");\n  }\n}","preventionTips":["Keep bitext QA runs on the default output format.","Only use --json for monolingual checks.","Build JSON post-processing in your pipeline instead of expecting native bitext JSON support."],"tags":["cli","conflicting-flags","json","bitext"],"backgroundTag":"mutually-exclusive-flags","analyzedSha":"2e990059ce67d5e2a0f7f7ca5d31160c6709df4b","analyzedAt":"2026-09-06T09:20:17.015Z","contentChangedAt":"2026-09-06T09:20:17.015Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}