code: Pipeline createPipeline(Language lang, Language motherTongue, TextChecker.QueryParams params, UserConfig userConfig)
      throws Exception { // package-private for mocking
      Pipeline lt = new Pipeline(lang, params.altLanguages, motherTongue, cache, userConfig);
      lt.setMaxErrorsPerWordRate(config.getMaxErrorsPerWordRate());
      if (config.getLanguageModelDir() != null) {
        lt.activateLanguageModelRules(config.getLanguageModelDir());
      }
      if (config.getWord2VecModelDir () != null) {
        lt.activateWord2VecModelRules(config.getWord2VecModelDir());
      }
      if (config.getRulesConfigFile() != null) {
        configureFromRulesFile(lt, lang);
      } else {
        configureFromGUI(lt, lang);
      }
      if (params.useQuerySettings) {
        Tools.selectRules(lt, new HashSet<>(params.disabledCategories), new HashSet<>(params.enabledCategories),
          new HashSet<>(params.disabledRules), new HashSet<>(params.enabledRules), params.useEnabledOnly);
      }
      if (pool != null) {
        lt.setupFinished();
      }
      return lt;
    }
docs: Create a JLanguageTool instance for a specific language, mother tongue, and rule configuration.
  Uses Pipeline wrapper to safely share objects
  
  @param lang the language to be used
  @param motherTongue the user's mother tongue or {@code null}