You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nlpcraft.apache.org by se...@apache.org on 2021/09/08 08:59:03 UTC

[incubator-nlpcraft] branch NLPCRAFT-434 created (now 8c7493c)

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

sergeykamov pushed a change to branch NLPCRAFT-434
in repository https://gitbox.apache.org/repos/asf/incubator-nlpcraft.git.


      at 8c7493c  WIP.

This branch includes the following new commits:

     new 8c7493c  WIP.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


[incubator-nlpcraft] 01/01: WIP.

Posted by se...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 8c7493c796f9fa6e010c7a18d1b5ac4b2f39fa2e
Author: Sergey Kamov <sk...@gmail.com>
AuthorDate: Wed Sep 8 11:58:53 2021 +0300

    WIP.
---
 .../apache/nlpcraft/model/NCElementDefinition.java | 37 ++++++++++++++++++++++
 .../probe/mgrs/deploy/NCDeployManager.scala        |  5 +--
 2 files changed, 40 insertions(+), 2 deletions(-)

diff --git a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/NCElementDefinition.java b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/NCElementDefinition.java
new file mode 100644
index 0000000..8f1d491
--- /dev/null
+++ b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/NCElementDefinition.java
@@ -0,0 +1,37 @@
+/*
+ * 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
+ *
+ *      http://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.model;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+@Documented
+@Retention(value=RUNTIME)
+@Target(value=PARAMETER)
+public @interface NCElementDefinition {
+    /**
+     * ID of the intent term.
+     *
+     * @return ID of the intent term.
+     */
+    String value();
+}
diff --git a/nlpcraft/src/main/scala/org/apache/nlpcraft/probe/mgrs/deploy/NCDeployManager.scala b/nlpcraft/src/main/scala/org/apache/nlpcraft/probe/mgrs/deploy/NCDeployManager.scala
index fddc682..9dd443d 100644
--- a/nlpcraft/src/main/scala/org/apache/nlpcraft/probe/mgrs/deploy/NCDeployManager.scala
+++ b/nlpcraft/src/main/scala/org/apache/nlpcraft/probe/mgrs/deploy/NCDeployManager.scala
@@ -63,6 +63,7 @@ object NCDeployManager extends NCService {
     private final val CLS_SAMPLE_REF = classOf[NCIntentSampleRef]
     private final val CLS_MDL_CLS_REF = classOf[NCModelAddClasses]
     private final val CLS_MDL_PKGS_REF = classOf[NCModelAddPackage]
+    private final val CLS_ELEM_DEF = classOf[NCElementDefinition]
 
     // Java and scala lists.
     private final val CLS_SCALA_SEQ = classOf[Seq[_]]
@@ -173,11 +174,11 @@ object NCDeployManager extends NCService {
         for (elm <- mdl.getElements.asScala) {
             if (!elm.getId.matches(ID_REGEX))
                 throw new NCE(
-                s"Model element ID does not match regex [" +
+                    s"Model element ID does not match regex [" +
                     s"mdlId=$mdlId, " +
                     s"elmId=${elm.getId}, " +
                     s"regex=$ID_REGEX" +
-                s"]"
+                    s"]"
             )
         }