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/03/27 07:53:23 UTC
[incubator-nlpcraft] branch NLPCRAFT-235 updated: WIP.
This is an automated email from the ASF dual-hosted git repository.
sergeykamov pushed a commit to branch NLPCRAFT-235
in repository https://gitbox.apache.org/repos/asf/incubator-nlpcraft.git
The following commit(s) were added to refs/heads/NLPCRAFT-235 by this push:
new ae4b485 WIP.
ae4b485 is described below
commit ae4b4852b1b2f3059bdc2a8ee58149ab5f72c015
Author: Sergey Kamov <sk...@gmail.com>
AuthorDate: Sat Mar 27 10:53:08 2021 +0300
WIP.
---
...onymsSpecTmp.scala => NCSuspSynonymsSpec.scala} | 25 ++++++++++++----------
1 file changed, 14 insertions(+), 11 deletions(-)
diff --git a/nlpcraft/src/test/scala/org/apache/nlpcraft/model/synonyms/NCSynonymsSpecTmp.scala b/nlpcraft/src/test/scala/org/apache/nlpcraft/model/synonyms/NCSuspSynonymsSpec.scala
similarity index 62%
rename from nlpcraft/src/test/scala/org/apache/nlpcraft/model/synonyms/NCSynonymsSpecTmp.scala
rename to nlpcraft/src/test/scala/org/apache/nlpcraft/model/synonyms/NCSuspSynonymsSpec.scala
index 6bae68b..bf096ab 100644
--- a/nlpcraft/src/test/scala/org/apache/nlpcraft/model/synonyms/NCSynonymsSpecTmp.scala
+++ b/nlpcraft/src/test/scala/org/apache/nlpcraft/model/synonyms/NCSuspSynonymsSpec.scala
@@ -23,24 +23,27 @@ import org.junit.jupiter.api.Test
import java.util
-class NCSynonymsSpecModelTmp extends NCModelAdapter("nlpcraft.syns.test.mdl", "Synonyms Test Model", "1.0") {
- // Default values.
- override def isPermutateSynonyms: Boolean = true
- override def getJiggleFactor: Int = 4
-
+class NCSuspSynonymsSpecModel extends NCModelAdapter("nlpcraft.susp.syns.test.mdl", "Synonyms Test Model", "1.0") {
override def getElements: util.Set[NCElement] =
Set(
- NCTestElement("wrapper", "^^{tok_id() == 'unknown'}^^")
+ NCTestElement("a"),
+
+ NCTestElement("e1", "a?"),
+ NCTestElement("e2", "a*"),
+ NCTestElement("e3", "a+"),
+ NCTestElement("e4", "a? a+"),
+ NCTestElement("e5", "a? a+ a*"),
)
- @NCIntent("intent=onWrapper term(t)={tok_id() == 'wrapper'}")
- def onWrapper(ctx: NCIntentMatch): NCResult = NCResult.text("OK")
+ @NCIntent("intent=onA term(t)={tok_id() == 'a'}")
+ def onA(ctx: NCIntentMatch): NCResult = NCResult.text("OK")
}
-@NCTestEnvironment(model = classOf[NCSynonymsSpecModelTmp], startClient = true)
-class NCSynonymsSpecTmp extends NCTestContext {
+@NCTestEnvironment(model = classOf[NCSuspSynonymsSpecModel], startClient = true)
+class NCSuspSynonymsSpec extends NCTestContext {
@Test
def test(): Unit = {
- require(getClient.ask("AAA").isFailed)
+ // Look at the warnings. It checks that probe was successfully started.
+ require(getClient.ask("a").isOk)
}
}