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 05a2c5d3 Minor fixes.
05a2c5d3 is described below
commit 05a2c5d33c640f103f50ac64a7941e63992e773b
Author: Sergey Kamov <[email protected]>
AuthorDate: Wed Oct 26 18:41:07 2022 +0400
Minor fixes.
---
.../org/apache/nlpcraft/examples/pizzeria/PizzeriaModel.scala | 10 +++++-----
.../org/apache/nlpcraft/nlp/parsers/NCNLPEntityParser.scala | 1 +
2 files changed, 6 insertions(+), 5 deletions(-)
diff --git
a/nlpcraft-examples/pizzeria/src/main/scala/org/apache/nlpcraft/examples/pizzeria/PizzeriaModel.scala
b/nlpcraft-examples/pizzeria/src/main/scala/org/apache/nlpcraft/examples/pizzeria/PizzeriaModel.scala
index fcd07ec9..a01dccac 100644
---
a/nlpcraft-examples/pizzeria/src/main/scala/org/apache/nlpcraft/examples/pizzeria/PizzeriaModel.scala
+++
b/nlpcraft-examples/pizzeria/src/main/scala/org/apache/nlpcraft/examples/pizzeria/PizzeriaModel.scala
@@ -69,7 +69,7 @@ object PizzeriaModel extends LazyLogging:
res
- private def askIsReady(): Result = mkDialog(s"Is order ready?") ->
DIALOG_IS_READY
+ private def askIsReady(): Result = mkDialog("Is order ready?") ->
DIALOG_IS_READY
private def askSpecify(o: Order): Result =
require(!o.isValid)
@@ -79,9 +79,9 @@ object PizzeriaModel extends LazyLogging:
mkDialog(s"Choose size (large, medium or small) for:
'${p.name}'") -> DIALOG_SPECIFY
case None =>
require(o.isEmpty)
- mkDialog(s"Please order something. Ask `menu` to look what you
can order.") -> DIALOG_SPECIFY
+ mkDialog("Please order something. Ask `menu` to look what you
can order.") -> DIALOG_SPECIFY
- private def askShouldStop(): Result = mkDialog(s"Should current order be
canceled?") -> DIALOG_SHOULD_CANCEL
+ private def askShouldStop(): Result = mkDialog("Should current order be
canceled?") -> DIALOG_SHOULD_CANCEL
private def doShowMenuResult(): NCResult =
mkResult(
@@ -106,8 +106,8 @@ object PizzeriaModel extends LazyLogging:
private def doStop(o: Order)(using ctx: NCContext, im: NCIntentMatch):
Result =
doResultWithClear(
- if !o.isEmpty then s"Everything cancelled. Ask `menu` to look what
you can order."
- else s"Nothing to cancel. Ask `menu` to look what you can order."
+ if !o.isEmpty then "Everything cancelled. Ask `menu` to look what
you can order."
+ else "Nothing to cancel. Ask `menu` to look what you can order."
)
private def doContinue(): Result = mkResult("OK, please continue.") ->
DIALOG_EMPTY
diff --git
a/nlpcraft/src/main/scala/org/apache/nlpcraft/nlp/parsers/NCNLPEntityParser.scala
b/nlpcraft/src/main/scala/org/apache/nlpcraft/nlp/parsers/NCNLPEntityParser.scala
index ffeff290..c894c729 100644
---
a/nlpcraft/src/main/scala/org/apache/nlpcraft/nlp/parsers/NCNLPEntityParser.scala
+++
b/nlpcraft/src/main/scala/org/apache/nlpcraft/nlp/parsers/NCNLPEntityParser.scala
@@ -40,6 +40,7 @@ class NCNLPEntityParser(predicate: NCToken => Boolean = _ =>
true) extends NCEnt
put(s"$id:text", t.getText)
put(s"$id:index", t.getIndex)
put(s"$id:startCharIndex", t.getStartCharIndex)
+ put(s"$id:endCharIndex", t.getEndCharIndex)
t.keysSet.foreach(key => put(s"$id:$key", t(key)))