{"record":{"id":"486cf157e9b16137","repo":"stanfordnlp/CoreNLP","slug":"conflicting-properties-multi-word-rules-file-will","errorCode":null,"errorMessage":"Conflicting properties. Multi-word rules file will be considered.","messagePattern":"Conflicting properties\\. Multi-word rules file will be considered\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/edu/stanford/nlp/process/stattok/StatTokSentTrainer.java","lineNumber":429,"sourceCode":"    String multiWordRulesFile \t= properties.getProperty(\"multiWordRulesFile\", null);\n    int windowSize \t\t= Integer.parseInt(properties.getProperty(\"windowSize\", \"4\")); //must reflect actual n. of features\n    boolean inferMultiWordRules = Integer.parseInt(properties.getProperty(\"inferMultiWordRules\", \"0\")) != 0;\n\n    if (properties.getProperty(\"help\", null) != null) {\n      help();\n      return;\n    }\n\n    if (trainFile == null){\n      logger.err(\"Error: No training file provided in properties or via command line.\");\n      return;\n    }\n\n    Map<String, String[]> multiWordRules = new HashMap<String, String[]>();\n    // Read or generate multi-word rules\n    if (multiWordRulesFile != null){\n      if (inferMultiWordRules){\n        logger.warn(\"Conflicting properties. Multi-word rules file will be considered.\");\n      }\n      logger.info(\"Reading Multi-Word rules file ... \");\n      multiWordRules = trainTokenizer.readMultiWordRules(multiWordRulesFile);\n    } else {\n      if (inferMultiWordRules){\n        logger.info(\"Inferring Multi-Word rules from training set ... \");\n        multiWordRules = trainTokenizer.inferMultiWordRules(trainFile);\n      }\n      else{\n        logger.warn(\"No multi-word rules provided. No inferMultiWordRules flag validated. Not inferring rules from training.\");\n      }\n    }\n\n    // Generate training file from ConLL-U\n    logger.info(\"Creating training set from \"+trainFile);\n    ArrayList<Pair<String, String>> classCharText = trainTokenizer.fileToTrainSet(trainFile,multiWordRules);\n    logger.info(\"Adding Features\");\n    List<String> trainingInput = trainTokenizer.addFeatures(classCharText, windowSize);","sourceCodeStart":411,"sourceCodeEnd":447,"githubUrl":"https://github.com/stanfordnlp/CoreNLP/blob/1b7edd19c4d0d7b1f13a2591425b9b60a0b1af7a/src/edu/stanford/nlp/process/stattok/StatTokSentTrainer.java#L411-L447","documentation":"StatTokSentTrainer trains a statistical sentence splitter. When both a multiWordRulesFile is supplied and inferMultiWordRules is enabled, the two options conflict; the trainer logs a warning and proceeds using the explicitly provided rules file, ignoring inference.","triggerScenarios":"Running StatTokSentTrainer.main with -multiWordRulesFile set and the inferMultiWordRules flag enabled at the same time.","commonSituations":"Leftover command-line flags from a previous training run; scripts that always pass the rules file while also enabling inference; misunderstanding that the file option takes precedence.","solutions":["Remove the inferMultiWordRules flag when supplying -multiWordRulesFile.","Remove -multiWordRulesFile if you want rules inferred from the training set.","Re-run training and confirm the intended rules source via the subsequent log lines.","Document which mode your training script uses to avoid conflicting flags."],"exampleFix":"// before\njava ... StatTokSentTrainer -multiWordRulesFile rules.tsv -inferMultiWordRules ...\n// after\njava ... StatTokSentTrainer -multiWordRulesFile rules.tsv ...","handlingStrategy":"validation","validationCode":"if (multiWordRulesFile != null && inferMultiWordRules) {\n  throw new IllegalArgumentException(\"Use either -multiWordRulesFile or -inferMultiWordRules, not both\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Build training scripts to pass either the rules file or the infer flag, never both","Echo effective options at trainer startup","Review the full command line in your training wrapper scripts"],"tags":["cli","configuration","training","conflicting-options"],"backgroundTag":"conflicting-config-options","analyzedSha":"1b7edd19c4d0d7b1f13a2591425b9b60a0b1af7a","analyzedAt":"2026-09-10T02:24:07.274Z","contentChangedAt":"2026-09-10T02:24:07.274Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}