code: private void updateOptionalLanguageModelRules(@Nullable LanguageModel lm) {
      ResourceBundle messages = getMessageBundle(language);
      try {
        List<Rule> rules = language.getRelevantLanguageModelCapableRules(messages, lm, userConfig, motherTongue, altLanguages);
        userRules.removeIf(rule -> optionalLanguageModelRules.contains(rule.getId()));
        optionalLanguageModelRules.clear();
        rules.stream().map(Rule::getId).forEach(optionalLanguageModelRules::add);
        userRules.addAll(rules);
      } catch(Exception e) {
        throw new RuntimeException("Could not load language model capable rules.", e);
      }
    }
docs: Remove rules that can profit from a language model, recreate them with the given model and add them again
  @param lm the language model or null if none is available