{"record":{"id":"35b7e2cb3378b1ea","repo":"languagetool-org/languagetool","slug":"form-has-more-than-1-modern-form-line","errorCode":null,"errorMessage":"Form has more than 1 modern form:\" + line","messagePattern":"Form has more than 1 modern form:\" \\+ line","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"languagetool-language-modules/ga/src/main/java/org/languagetool/rules/ga/DativePluralsData.java","lineNumber":61,"sourceCode":"  private static Set<DativePluralsEntry> loadWords(String path) {\n    Set<DativePluralsEntry> set = new HashSet<>();\n    InputStream stream = JLanguageTool.getDataBroker().getFromRulesDirAsStream(path);\n    try (Scanner scanner = new Scanner(stream, \"utf-8\")) {\n      while (scanner.hasNextLine()) {\n        String line = scanner.nextLine().trim();\n        if (line.isEmpty() || line.charAt(0) == '#') {\n          continue;\n        }\n        String[] parts = line.split(\";\");\n        if (parts.length != 4) {\n          throw new RuntimeException(\"Incorrect number of fields: \" + line);\n        }\n        String form = parts[0];\n        String formModern = null;\n        if (form.contains(\":\")) {\n          String[] forms = form.split(\":\");\n          if (forms.length != 2) {\n            throw new RuntimeException(\"Form has more than 1 modern form:\" + line);\n          }\n          form = forms[0];\n          formModern = forms[1];\n        }\n        String repl = parts[3];\n        String replModern = null;\n        if (repl.contains(\":\")) {\n          String[] repls = repl.split(\":\");\n          if (repls.length != 2) {\n            throw new RuntimeException(\"Replacement has more than 1 modern form:\" + line);\n          }\n          repl = repls[0];\n          replModern = repls[1];\n        }\n        String lemma = parts[1];\n        String lemmaModern = null;\n        if (lemma.contains(\":\")) {\n          String[] lemmata = lemma.split(\":\");","sourceCodeStart":43,"sourceCodeEnd":79,"githubUrl":"https://github.com/languagetool-org/languagetool/blob/2e990059ce67d5e2a0f7f7ca5d31160c6709df4b/languagetool-language-modules/ga/src/main/java/org/languagetool/rules/ga/DativePluralsData.java#L43-L79","documentation":"In DativePluralsData.loadWords, the first field (the dative form) may carry a modern variant using ':' as a separator (form:formModern). If splitting on ':' yields more than two parts — meaning multiple modern forms were supplied — this RuntimeException names the whole line.","triggerScenarios":"A data-file line whose form field contains two or more ':' characters (e.g. 'a:b:c'), so form.split(\":\").length != 2.","commonSituations":"Contributors adding several modern spellings in one line; typos leaving an extra colon; copying a multi-variant convention from another resource file.","solutions":["Edit the offending line so the form field has at most one colon: exactly one original form and one modern form.","If multiple modern forms exist, duplicate the line, one per modern form.","Verify no stray colon exists elsewhere in the field (e.g. an abbreviation).","Document the form:formModern convention in the data file header comment to prevent recurrence."],"exampleFix":"// before\nceart:cearta:ceartai; ceart; m; N...\n// after (one line per modern form)\nceart:cearta; ceart; m; N...\nceart:ceartai; ceart; m; N...","handlingStrategy":"validation","validationCode":"String form = line.split(\";\")[0];\nif (form.chars().filter(c -> c == ':').count() > 1)\n  throw new IllegalStateException(\"multiple modern forms in: \" + line);","typeGuard":null,"tryCatchPattern":"try { loadWords(reader); } catch (RuntimeException e) { log.error(\"Fix line: \" + e.getMessage()); }","preventionTips":["One line per modern form instead of colon-joining several","Grep for lines with 2+ colons before committing data changes","Document the form:formModern convention in the file header"],"tags":["java","languagetool","data-file","irish"],"backgroundTag":"invalid-argument-format","analyzedSha":"2e990059ce67d5e2a0f7f7ca5d31160c6709df4b","analyzedAt":"2026-09-06T09:20:17.015Z","contentChangedAt":"2026-09-06T09:20:17.015Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}