This is an automated email from the ASF dual-hosted git repository.
sergeykamov 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 b5a93954 Minor refactoring.
b5a93954 is described below
commit b5a93954df5ff5898391d25f4ac90d1a2eada469
Author: Sergey Kamov <[email protected]>
AuthorDate: Mon Oct 17 10:35:13 2022 +0400
Minor refactoring.
---
.../lightswitch/LightSwitchModelSpec.scala | 56 +++++++++++-----------
1 file changed, 27 insertions(+), 29 deletions(-)
diff --git
a/nlpcraft-examples/lightswitch/src/test/scala/org/apache/nlpcraft/examples/lightswitch/LightSwitchModelSpec.scala
b/nlpcraft-examples/lightswitch/src/test/scala/org/apache/nlpcraft/examples/lightswitch/LightSwitchModelSpec.scala
index 0e6e81a8..1cbf693f 100644
---
a/nlpcraft-examples/lightswitch/src/test/scala/org/apache/nlpcraft/examples/lightswitch/LightSwitchModelSpec.scala
+++
b/nlpcraft-examples/lightswitch/src/test/scala/org/apache/nlpcraft/examples/lightswitch/LightSwitchModelSpec.scala
@@ -26,34 +26,32 @@ import scala.util.Using
* JUnit models validation.
*/
class LightSwitchModelSpec extends AnyFunSuite:
- private def test(mdl: NCModel): Unit = Using.resource(new
NCModelClient(mdl)) { client =>
- def check(txt: String): Unit =
- require(client.debugAsk(txt, "userId", true).getIntentId == "ls")
-
- check("Turn the lights off in the entire house.")
- check("Turn off all lights now")
- check("Switch on the illumination in the master bedroom closet.")
- check("Get the lights on.")
- check("Off the lights on the 1st floor")
- check("Lights up in the kitchen.")
- check("Please, put the light out in the upstairs bedroom.")
- check("Set the lights on in the entire house.")
- check("Turn the lights off in the guest bedroom.")
- check("Could you please switch off all the lights?")
- check("Dial off illumination on the 2nd floor.")
- check("Turn down lights in 1st floor bedroom")
- check("Lights on at second floor kitchen")
- check("Please, no lights!")
- check("Kill off all the lights now!")
- check("Down the lights in the garage")
- check("Lights down in the kitchen!")
- check("Turn up the illumination in garage and master bedroom")
- check("Turn down all the light now!")
- check("No lights in the bedroom, please.")
- check("Light up the garage, please!")
- check("Kill the illumination now!")
- }
-
test("test") {
- test(new LightSwitchModel())
+ Using.resource(new NCModelClient(new LightSwitchModel())) { client =>
+ def check(txt: String): Unit =
+ require(client.debugAsk(txt, "userId", true).getIntentId ==
"ls")
+
+ check("Turn the lights off in the entire house.")
+ check("Turn off all lights now")
+ check("Switch on the illumination in the master bedroom closet.")
+ check("Get the lights on.")
+ check("Off the lights on the 1st floor")
+ check("Lights up in the kitchen.")
+ check("Please, put the light out in the upstairs bedroom.")
+ check("Set the lights on in the entire house.")
+ check("Turn the lights off in the guest bedroom.")
+ check("Could you please switch off all the lights?")
+ check("Dial off illumination on the 2nd floor.")
+ check("Turn down lights in 1st floor bedroom")
+ check("Lights on at second floor kitchen")
+ check("Please, no lights!")
+ check("Kill off all the lights now!")
+ check("Down the lights in the garage")
+ check("Lights down in the kitchen!")
+ check("Turn up the illumination in garage and master bedroom")
+ check("Turn down all the light now!")
+ check("No lights in the bedroom, please.")
+ check("Light up the garage, please!")
+ check("Kill the illumination now!")
+ }
}