Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id CBC42200BEB for ; Wed, 14 Dec 2016 00:46:31 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id CA4EC160B32; Tue, 13 Dec 2016 23:46:31 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 1D4F0160B31 for ; Wed, 14 Dec 2016 00:46:30 +0100 (CET) Received: (qmail 23009 invoked by uid 500); 13 Dec 2016 23:46:30 -0000 Mailing-List: contact commits-help@opennlp.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@opennlp.apache.org Delivered-To: mailing list commits@opennlp.apache.org Received: (qmail 22987 invoked by uid 99); 13 Dec 2016 23:46:30 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 13 Dec 2016 23:46:30 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id C5A46E95B8; Tue, 13 Dec 2016 23:46:29 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: joern@apache.org To: commits@opennlp.apache.org Date: Tue, 13 Dec 2016 23:46:29 -0000 Message-Id: <28ead7ae55a945a8a935822da64cf31a@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [1/2] opennlp git commit: Revert "Remove deprecated API from the Parser" archived-at: Tue, 13 Dec 2016 23:46:32 -0000 Repository: opennlp Updated Branches: refs/heads/trunk 9c140512d -> 080656237 Revert "Remove deprecated API from the Parser" That should not have been merged, caused compile errors. This reverts commit 9c140512d9caadda9ea469b679766870304ce947. Project: http://git-wip-us.apache.org/repos/asf/opennlp/repo Commit: http://git-wip-us.apache.org/repos/asf/opennlp/commit/d62cc416 Tree: http://git-wip-us.apache.org/repos/asf/opennlp/tree/d62cc416 Diff: http://git-wip-us.apache.org/repos/asf/opennlp/diff/d62cc416 Branch: refs/heads/trunk Commit: d62cc416b5fb6db89b624c3b5203711ad597ebe4 Parents: 9c14051 Author: Jörn Kottmann Authored: Wed Dec 14 00:39:34 2016 +0100 Committer: Jörn Kottmann Committed: Wed Dec 14 00:39:34 2016 +0100 ---------------------------------------------------------------------- .../opennlp/tools/parser/chunking/Parser.java | 32 ++++++++++++++++++++ 1 file changed, 32 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/opennlp/blob/d62cc416/opennlp-tools/src/main/java/opennlp/tools/parser/chunking/Parser.java ---------------------------------------------------------------------- diff --git a/opennlp-tools/src/main/java/opennlp/tools/parser/chunking/Parser.java b/opennlp-tools/src/main/java/opennlp/tools/parser/chunking/Parser.java index 77a030f..044477b 100644 --- a/opennlp-tools/src/main/java/opennlp/tools/parser/chunking/Parser.java +++ b/opennlp-tools/src/main/java/opennlp/tools/parser/chunking/Parser.java @@ -248,6 +248,15 @@ public class Parser extends AbstractBottomUpParser { return newParses; } + /** + * @deprecated Please do not use anymore, use the ObjectStream train methods instead! This method + * will be removed soon. + */ + @Deprecated + public static AbstractModel train(ObjectStream es, int iterations, int cut) throws java.io.IOException { + return opennlp.tools.ml.maxent.GIS.trainModel(iterations, new TwoPassDataIndexer(es, cut)); + } + public static void mergeReportIntoManifest(Map manifest, Map report, String namespace) { @@ -309,4 +318,27 @@ public class Parser extends AbstractBottomUpParser { posModel, chunkModel, (opennlp.tools.parser.HeadRules) rules, ParserType.CHUNKING, manifestInfoEntries); } + + /** + * @deprecated use {@link #train(String, ObjectStream, HeadRules, TrainingParameters)} + * instead and pass in a TrainingParameters object. + */ + @Deprecated + public static ParserModel train(String languageCode, ObjectStream 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); + } }