public static ParserModel train(String languageCode,
ObjectStream<Parse> parseSamples, HeadRules rules, int iterations, int cut)
throws IOException {
TrainingParameters params = new TrainingParameters();
params.put("dict", TrainingParameters.CUTOFF_PARAM, Integer.toString(cut));
params.put("tagger", TrainingParameters.CUTOFF_PARAM, Integer.toString(cut));
params.put("tagger", TrainingParameters.ITERATIONS_PARAM, Integer.toString(iterations));
params.put("chunker", TrainingParameters.CUTOFF_PARAM, Integer.toString(cut));
params.put("chunker", TrainingParameters.ITERATIONS_PARAM, Integer.toString(iterations));
params.put("check", TrainingParameters.CUTOFF_PARAM, Integer.toString(cut));
params.put("check", TrainingParameters.ITERATIONS_PARAM, Integer.toString(iterations));
params.put("build", TrainingParameters.CUTOFF_PARAM, Integer.toString(cut));
params.put("build", TrainingParameters.ITERATIONS_PARAM, Integer.toString(iterations));
return train(languageCode, parseSamples, rules, params);
}