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 <[email protected]> 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"]" ) }
