You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nlpcraft.apache.org by ar...@apache.org on 2020/12/14 02:11:38 UTC
[incubator-nlpcraft] 03/03: Improvements on CLI docs.
This is an automated email from the ASF dual-hosted git repository.
aradzinski pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nlpcraft.git
commit 880f25d1e206fcf7bd7a6cf2d1b5781501b6f879
Author: Aaron Radzinski <ar...@datalingvo.com>
AuthorDate: Sun Dec 13 18:11:22 2020 -0800
Improvements on CLI docs.
---
.../apache/nlpcraft/model/tools/cmdline/NCCli.scala | 19 ++++++++++---------
.../test/impl/NCTestAutoModelValidatorImpl.scala | 4 +---
2 files changed, 11 insertions(+), 12 deletions(-)
diff --git a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/tools/cmdline/NCCli.scala b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/tools/cmdline/NCCli.scala
index 82e0d0c..3e6da2b 100644
--- a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/tools/cmdline/NCCli.scala
+++ b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/tools/cmdline/NCCli.scala
@@ -861,7 +861,8 @@ object NCCli extends App {
synopsis = s"Generates NLPCraft model stub from SQL databases.",
desc = Some(
s"You can choose database schema, set of tables and columns for which you want to generate NLPCraft " +
- s"model. After the model is generated you can further configure and customize it for your specific needs."
+ s"model. After the model is generated you can further configure and customize it for your specific needs. " +
+ s"Find more information at ${y("https://nlpcraft.apache.org/tools/sql_model_gen.html")}"
),
body = cmdSqlGen,
params = Seq(
@@ -1013,13 +1014,13 @@ object NCCli extends App {
Example(
usage = Seq(
s"$PROMPT $SCRIPT_NAME gen-sql",
- " -r=jdbc:postgresql://localhost:5432/mydb",
- " -d=org.postgresql.Driver",
- """ -f="tbl_, col_"""",
- """ -q="_tmp, _old, _unused"""",
- " -s=public",
- """ -e="#_.+"""",
- " -o=model.json"
+ " --url=jdbc:postgresql://localhost:5432/mydb",
+ " --driver=org.postgresql.Driver",
+ """ --prefix="tbl_, col_"""",
+ """ --suffix="_tmp, _old, _unused"""",
+ " --schema=public",
+ """ --exclude="#_.+"""",
+ " --out=model.json"
),
desc =
s"Generates model stub from given SQL database connection."
@@ -1035,7 +1036,7 @@ object NCCli extends App {
s"it requires user to be signed in. REPL session keeps the currently active access " +
s"token after user signed in. For command line mode, use ${c("'rest'")} command with " +
s"corresponding parameters. Note also that it requires a local probe running that hosts " +
- s"the specified model."
+ s"the specified model. Find more information about this tool at ${y("https://nlpcraft.apache.org/tools/syn_tool.html")}"
),
body = cmdSugSyn,
params = Seq(
diff --git a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/tools/test/impl/NCTestAutoModelValidatorImpl.scala b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/tools/test/impl/NCTestAutoModelValidatorImpl.scala
index 9f6dda2..97a1ed3 100644
--- a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/tools/test/impl/NCTestAutoModelValidatorImpl.scala
+++ b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/tools/test/impl/NCTestAutoModelValidatorImpl.scala
@@ -132,9 +132,7 @@ private [test] object NCTestAutoModelValidatorImpl extends LazyLogging {
private def getClasses(s: Array[String]): Seq[Class[_ <: NCModel]] = {
val clsLdr = Thread.currentThread().getContextClassLoader
- s.
- map(_.trim).
- filter(_.nonEmpty).
+ U.trimFilter(s).
map(clsLdr.loadClass).
map(_.asSubclass(classOf[NCModel]))
}