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

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


The following commit(s) were added to refs/heads/NLPCRAFT-491 by this push:
     new f3c54db8 Minor fixes.
f3c54db8 is described below

commit f3c54db8aa350967ed0c25ce6346d53b1b22a017
Author: Sergey Kamov <[email protected]>
AuthorDate: Tue May 3 10:27:17 2022 +0300

    Minor fixes.
---
 .../org/apache/nlpcraft/examples/pizzeria/PizzeriaModel.scala     | 4 ++--
 .../org/apache/nlpcraft/examples/pizzeria/PizzeriaOrder.scala     | 8 ++++----
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git 
a/nlpcraft-examples/pizzeria/src/main/java/org/apache/nlpcraft/examples/pizzeria/PizzeriaModel.scala
 
b/nlpcraft-examples/pizzeria/src/main/java/org/apache/nlpcraft/examples/pizzeria/PizzeriaModel.scala
index 2d157cb9..d135ccaa 100644
--- 
a/nlpcraft-examples/pizzeria/src/main/java/org/apache/nlpcraft/examples/pizzeria/PizzeriaModel.scala
+++ 
b/nlpcraft-examples/pizzeria/src/main/java/org/apache/nlpcraft/examples/pizzeria/PizzeriaModel.scala
@@ -82,7 +82,7 @@ class PizzeriaModel extends NCModelAdapter(new 
NCModelConfig("nlpcraft.pizzeria.
     private def askSpecify(o: Order): ResultState =
         require(!o.isValid)
 
-        o.findPizzaNoSize match
+        o.findPizzaWithoutSize match
             case Some(p) =>
                 NCResult(s"Choose size (large, medium or small) for: 
'${p.name}'", ASK_DIALOG) -> DIALOG_SPECIFY
             case None =>
@@ -234,7 +234,7 @@ class PizzeriaModel extends NCModelAdapter(new 
NCModelConfig("nlpcraft.pizzeria.
     def onOrderSpecify(im: NCIntentMatch, @NCIntentTerm("size") size: 
NCEntity): NCResult = execute(
         im,
         // If order in progress and has pizza with unknown size, it doesn't 
depend on dialog state.
-        o => if !o.isEmpty && o.fixPizzaNoSize(extractPizzaSize(size)) then 
askIsReadyOrAskSpecify(o) else throw UNEXPECTED_REQUEST
+        o => if !o.isEmpty && o.fixPizzaWithoutSize(extractPizzaSize(size)) 
then askIsReadyOrAskSpecify(o) else throw UNEXPECTED_REQUEST
     )
 
     override def onRejection(im: NCIntentMatch, e: NCRejection): NCResult =
diff --git 
a/nlpcraft-examples/pizzeria/src/main/java/org/apache/nlpcraft/examples/pizzeria/PizzeriaOrder.scala
 
b/nlpcraft-examples/pizzeria/src/main/java/org/apache/nlpcraft/examples/pizzeria/PizzeriaOrder.scala
index 709e11c4..a537df4c 100644
--- 
a/nlpcraft-examples/pizzeria/src/main/java/org/apache/nlpcraft/examples/pizzeria/PizzeriaOrder.scala
+++ 
b/nlpcraft-examples/pizzeria/src/main/java/org/apache/nlpcraft/examples/pizzeria/PizzeriaOrder.scala
@@ -75,7 +75,7 @@ class PizzeriaOrder:
       *
       * @return
       */
-    def isValid: Boolean = !isEmpty && findPizzaNoSize.isEmpty
+    def isValid: Boolean = !isEmpty && findPizzaWithoutSize.isEmpty
 
     /**
       *
@@ -120,14 +120,14 @@ class PizzeriaOrder:
       *
       * @return
       */
-    def findPizzaNoSize: Option[Pizza] = pizzas.find(_.size.isEmpty)
+    def findPizzaWithoutSize: Option[Pizza] = pizzas.find(_.size.isEmpty)
 
     /**
       *
        * @param size
       */
-    def fixPizzaNoSize(size: String): Boolean =
-        findPizzaNoSize match
+    def fixPizzaWithoutSize(size: String): Boolean =
+        findPizzaWithoutSize match
             case Some(p) =>
                 p.size = Option(size)
                 true

Reply via email to