This is an automated email from the ASF dual-hosted git repository.
sergeykamov pushed a commit to branch NLPCRAFT-443
in repository https://gitbox.apache.org/repos/asf/incubator-nlpcraft.git
The following commit(s) were added to refs/heads/NLPCRAFT-443 by this push:
new 6a33cfa WIP.
6a33cfa is described below
commit 6a33cfa1b5ae1e94ddb972d665aff80f97069c5c
Author: Sergey Kamov <[email protected]>
AuthorDate: Wed Sep 15 09:47:57 2021 +0300
WIP.
---
.../model/stop/NCStopWordsInsideSpec.scala | 51 ++++++++++++++++++++++
1 file changed, 51 insertions(+)
diff --git
a/nlpcraft/src/test/scala/org/apache/nlpcraft/model/stop/NCStopWordsInsideSpec.scala
b/nlpcraft/src/test/scala/org/apache/nlpcraft/model/stop/NCStopWordsInsideSpec.scala
new file mode 100644
index 0000000..64ddf02
--- /dev/null
+++
b/nlpcraft/src/test/scala/org/apache/nlpcraft/model/stop/NCStopWordsInsideSpec.scala
@@ -0,0 +1,51 @@
+/*
+ * 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.model.stop
+
+import org.apache.nlpcraft.model.{NCElement, NCIntent, NCModelAdapter,
NCResult}
+import org.apache.nlpcraft.{NCTestContext, NCTestElement, NCTestEnvironment}
+import org.junit.jupiter.api.Test
+
+import java.util
+import scala.language.implicitConversions
+
+/**
+ *
+ */
+class NCStopWordsInsideModel extends NCModelAdapter("nlpcraft.test", "Test
Model", "1.0") {
+ override def getElements: util.Set[NCElement] =
Set(NCTestElement("complex", "a b"))
+
+ @NCIntent("intent=i term={# == 'complex'}")
+ private def onI(): NCResult = NCResult.text("OK")
+}
+
+/**
+ *
+ */
+@NCTestEnvironment(model = classOf[NCStopWordsInsideModel], startClient = true)
+class NCStopWordsInsideSpec extends NCTestContext {
+ @Test
+ def test(): Unit = {
+ checkIntent("a b", "i")
+ checkResult("a the b", "i")
+ checkResult("a , b", "i")
+ checkResult("a,,b", "i")
+ checkResult("a, ,b", "i")
+ checkResult("a, the,b", "i")
+ }
+}
\ No newline at end of file