This is an automated email from the ASF dual-hosted git repository.
sergeykamov pushed a commit to branch NLPCRAFT-383
in repository https://gitbox.apache.org/repos/asf/incubator-nlpcraft.git
The following commit(s) were added to refs/heads/NLPCRAFT-383 by this push:
new 4839568 WIP.
4839568 is described below
commit 4839568f7f227957e52b395436119be5e8063356
Author: Sergey Kamov <[email protected]>
AuthorDate: Fri Aug 6 19:29:55 2021 +0300
WIP.
---
.../nlpcraft/examples/solarsystem/SolarSystemModel.scala | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git
a/nlpcraft-examples/solarsystem/src/main/java/org/apache/nlpcraft/examples/solarsystem/SolarSystemModel.scala
b/nlpcraft-examples/solarsystem/src/main/java/org/apache/nlpcraft/examples/solarsystem/SolarSystemModel.scala
index 818d600..a28e4b6 100644
---
a/nlpcraft-examples/solarsystem/src/main/java/org/apache/nlpcraft/examples/solarsystem/SolarSystemModel.scala
+++
b/nlpcraft-examples/solarsystem/src/main/java/org/apache/nlpcraft/examples/solarsystem/SolarSystemModel.scala
@@ -114,16 +114,16 @@ class SolarSystemModel extends
NCModelFileAdapter("solarsystem_model.yaml") with
val dateStr = row("discoveryDate").asInstanceOf[String]
if (dateStr.nonEmpty) {
- supportedFmts.flatMap(p => {
+ supportedFmts.flatMap(p =>
try {
- val time = LocalDate.parse(dateStr,
p).atStartOfDay(ZoneOffset.UTC).toInstant.toEpochMilli
+ val ms = LocalDate.parse(dateStr,
p).atStartOfDay(ZoneOffset.UTC).toInstant.toEpochMilli
- Some(time >= from && time <= to)
+ Some(ms >= from && ms <= to)
}
catch {
case _: DateTimeParseException => None
}
- }).
+ ).
to(LazyList).
headOption.
getOrElse(throw new AssertionError(s"Template not found
for: $dateStr"))
@@ -132,8 +132,6 @@ class SolarSystemModel extends
NCModelFileAdapter("solarsystem_model.yaml") with
false
})
- println("after=" + res.size)
-
NCResult.text(res.toString())
}
}
\ No newline at end of file