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

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


The following commit(s) were added to refs/heads/master by this push:
     new 5688c0b  WIP.
5688c0b is described below

commit 5688c0bfb30b661093bf90b747b760fb69e74204
Author: Aaron Radzinski <[email protected]>
AuthorDate: Tue Dec 7 18:48:42 2021 -0800

    WIP.
---
 .../scala/org/apache/nlpcraft/NCModelConfig.java   | 15 ++++-
 .../apache/nlpcraft/NCModelConfigFileAdapter.java  | 12 +++-
 .../apache/nlpcraft/NCParameterizedAdapter.java    | 69 ++++++++++++++++++++++
 3 files changed, 93 insertions(+), 3 deletions(-)

diff --git a/nlpcraft/src/main/scala/org/apache/nlpcraft/NCModelConfig.java 
b/nlpcraft/src/main/scala/org/apache/nlpcraft/NCModelConfig.java
index 998cb16..d944dfc 100644
--- a/nlpcraft/src/main/scala/org/apache/nlpcraft/NCModelConfig.java
+++ b/nlpcraft/src/main/scala/org/apache/nlpcraft/NCModelConfig.java
@@ -34,11 +34,16 @@ public interface NCModelConfig extends NCParameterized {
     int DFLT_MAX_TOKENS = 50;
 
     /**
-     * Default value for {@link #getMinNonStopwords()} method.
+     * Default value for {@link #getMinNonStopWords()} method.
      */
     int DFLT_MIN_NON_STOPWORDS = 0;
 
     /**
+     * Default value for {@link #getMaxStopWords()} method.
+     */
+    int DFLT_MAX_STOPWORDS = 15;
+
+    /**
      * Default value for {@link #isNotLatinCharsetAllowed()} method.
      */
     boolean DFLT_IS_NOT_LATIN_CHARSET_ALLOWED = false;
@@ -124,7 +129,13 @@ public interface NCModelConfig extends NCParameterized {
         return DFLT_MAX_TOKENS;
     }
 
-    int getMaxStopWords();
+    /**
+     *
+     * @return
+     */
+    default int getMaxStopWords() {
+        return DFLT_MAX_STOPWORDS;
+    }
 
     /**
      *
diff --git 
a/nlpcraft/src/main/scala/org/apache/nlpcraft/NCModelConfigFileAdapter.java 
b/nlpcraft/src/main/scala/org/apache/nlpcraft/NCModelConfigFileAdapter.java
index 0349779..abd34d4 100644
--- a/nlpcraft/src/main/scala/org/apache/nlpcraft/NCModelConfigFileAdapter.java
+++ b/nlpcraft/src/main/scala/org/apache/nlpcraft/NCModelConfigFileAdapter.java
@@ -22,7 +22,7 @@ import java.util.*;
 /**
  *
  */
-public class NCModelConfigFileAdapter implements NCModelConfig {
+public class NCModelConfigFileAdapter extends NCParameterizedAdapter 
implements NCModelConfig {
     @Override
     public String getId() {
         return null; // TODO
@@ -39,6 +39,16 @@ public class NCModelConfigFileAdapter implements 
NCModelConfig {
     }
 
     @Override
+    public List<NCTokenEnricher> getTokenEnrichers() {
+        return null; // TODO
+    }
+
+    @Override
+    public List<NCEntityEnricher> getEntityEnrichers() {
+        return null; // TODO
+    }
+
+    @Override
     public NCTokenParser getTokenParser() {
         return null; // TODO
     }
diff --git 
a/nlpcraft/src/main/scala/org/apache/nlpcraft/NCParameterizedAdapter.java 
b/nlpcraft/src/main/scala/org/apache/nlpcraft/NCParameterizedAdapter.java
new file mode 100644
index 0000000..ec76e29
--- /dev/null
+++ b/nlpcraft/src/main/scala/org/apache/nlpcraft/NCParameterizedAdapter.java
@@ -0,0 +1,69 @@
+/*
+ * 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;/*
+   _________            ______________
+   __  ____/_______________  __ \__  /_____ _____  __
+   _  /    _  __ \_  ___/_  /_/ /_  /_  __ `/_  / / /
+   / /___  / /_/ /(__  )_  ____/_  / / /_/ /_  /_/ /
+   \____/  \____//____/ /_/     /_/  \__,_/ _\__, /
+                                            /____/
+
+          2D ASCII JVM GAME ENGINE FOR SCALA3
+              (C) 2021 Rowan Games, Inc.
+                ALl rights reserved.
+*/
+
+import java.util.HashMap;
+import java.util.Optional;
+
+/**
+ *
+ */
+public class NCParameterizedAdapter implements NCParameterized {
+    private HashMap<String, Object> map = new HashMap<>();
+
+    @Override
+    public <T> T get(String key) {
+        return (T)map.get(key);
+    }
+
+    @Override
+    public <T> Optional<T> getOpt(String key) {
+        return Optional.empty();
+    }
+
+    @Override
+    public void put(String key, Object obj) {
+
+    }
+
+    @Override
+    public <T> T putIfAbsent(String key, T obj) {
+        return null;
+    }
+
+    @Override
+    public boolean contains(String key) {
+        return false;
+    }
+
+    @Override
+    public boolean remove(String key) {
+        return false;
+    }
+}

Reply via email to