You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nlpcraft.apache.org by ar...@apache.org on 2021/12/17 03:11:15 UTC

[incubator-nlpcraft] 02/02: WIP.

This is an automated email from the ASF dual-hosted git repository.

aradzinski pushed a commit to branch master_test
in repository https://gitbox.apache.org/repos/asf/incubator-nlpcraft.git

commit a571917c003350f074c15c733f807ae0d6aefc01
Author: Aaron Radzinski <ar...@datalingvo.com>
AuthorDate: Thu Dec 16 19:11:06 2021 -0800

    WIP.
---
 .../token/parser/opennlp/NCOpenNlpTokenParser.java | 19 +++++-----------
 .../token/parser/opennlp/impl/NCOpenNlpImpl.scala  | 26 ++++++++++++++++++++++
 2 files changed, 32 insertions(+), 13 deletions(-)

diff --git a/nlpcraft/src/main/scala/org/apache/nlpcraft/internal/nlp/token/parser/opennlp/NCOpenNlpTokenParser.java b/nlpcraft/src/main/scala/org/apache/nlpcraft/internal/nlp/token/parser/opennlp/NCOpenNlpTokenParser.java
index fc741e5..8f3e155 100644
--- a/nlpcraft/src/main/scala/org/apache/nlpcraft/internal/nlp/token/parser/opennlp/NCOpenNlpTokenParser.java
+++ b/nlpcraft/src/main/scala/org/apache/nlpcraft/internal/nlp/token/parser/opennlp/NCOpenNlpTokenParser.java
@@ -26,15 +26,18 @@ import java.io.InputStream;
 import java.util.List;
 
 
-/**
- * TODO:
+/*
  * Models can be downloaded from the following resources:
  *  - tokenizer: http://opennlp.sourceforge.net/models-1.5/en-token.bin
  *  - tagger: http://opennlp.sourceforge.net/models-1.5/en-pos-maxent.bin
  *  - lemmatizer: https://raw.githubusercontent.com/richardwilly98/elasticsearch-opennlp-auto-tagging/master/src/main/resources/models/en-lemmatizer.dict
  */
+
+/**
+ *
+ */
 public class NCOpenNlpTokenParser implements NCTokenParser {
-    private final NCOpenNlpTokenParserImpl delegate;
+    private final NCOpenNlpTokenParserImpl impl;
 
     /**
      *
@@ -67,16 +70,6 @@ public class NCOpenNlpTokenParser implements NCTokenParser {
     }
 
     @Override
-    public void start() {
-        delegate.start();
-    }
-
-    @Override
-    public void stop() {
-        delegate.stop();
-    }
-
-    @Override
     public List<NCToken> parse(NCRequest req) {
         return delegate.parse(req);
     }
diff --git a/nlpcraft/src/main/scala/org/apache/nlpcraft/internal/nlp/token/parser/opennlp/impl/NCOpenNlpImpl.scala b/nlpcraft/src/main/scala/org/apache/nlpcraft/internal/nlp/token/parser/opennlp/impl/NCOpenNlpImpl.scala
new file mode 100644
index 0000000..fa600c4
--- /dev/null
+++ b/nlpcraft/src/main/scala/org/apache/nlpcraft/internal/nlp/token/parser/opennlp/impl/NCOpenNlpImpl.scala
@@ -0,0 +1,26 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.nlpcraft.internal.nlp.token.parser.opennlp.impl
+
+import org.apache.nlpcraft.*
+
+/**
+  *
+  */
+class NCOpenNlpImpl:
+    def parse(req: NCRequest): java.util.List[NCToken] = ???