You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opennlp.apache.org by co...@apache.org on 2012/02/23 15:27:46 UTC
svn commit: r1292815 -
/opennlp/trunk/opennlp-tools/src/main/java/opennlp/tools/sentdetect/SentenceDetectorME.java
Author: colen
Date: Thu Feb 23 14:27:45 2012
New Revision: 1292815
URL: http://svn.apache.org/viewvc?rev=1292815&view=rev
Log:
OPENNLP-434: Changed SentenceDetectorME constructor to load configurations using the SentenceDetectorFactory from model
Modified:
opennlp/trunk/opennlp-tools/src/main/java/opennlp/tools/sentdetect/SentenceDetectorME.java
Modified: opennlp/trunk/opennlp-tools/src/main/java/opennlp/tools/sentdetect/SentenceDetectorME.java
URL: http://svn.apache.org/viewvc/opennlp/trunk/opennlp-tools/src/main/java/opennlp/tools/sentdetect/SentenceDetectorME.java?rev=1292815&r1=1292814&r2=1292815&view=diff
==============================================================================
--- opennlp/trunk/opennlp-tools/src/main/java/opennlp/tools/sentdetect/SentenceDetectorME.java (original)
+++ opennlp/trunk/opennlp-tools/src/main/java/opennlp/tools/sentdetect/SentenceDetectorME.java Thu Feb 23 14:27:45 2012
@@ -87,9 +87,17 @@ public class SentenceDetectorME implemen
* @param model the {@link SentenceModel}
*/
public SentenceDetectorME(SentenceModel model) {
- this(model, new Factory());
+ SentenceDetectorFactory sdFactory = model.getFactory();
+ this.model = model.getMaxentModel();
+ cgen = sdFactory.getSDContextGenerator();
+ scanner = sdFactory.getEndOfSentenceScanner();
+ useTokenEnd = sdFactory.isUseTokenEnd();
}
+ /**
+ * @deprecated Use a {@link SentenceDetectorFactory} to extend
+ * SentenceDetector functionality.
+ */
public SentenceDetectorME(SentenceModel model, Factory factory) {
this.model = model.getMaxentModel();
// if the model has custom EOS characters set, use this to get the context