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/05/29 02:06:06 UTC
[incubator-nlpcraft] branch master updated: Misc. fixes.
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
The following commit(s) were added to refs/heads/master by this push:
new fc4c229 Misc. fixes.
fc4c229 is described below
commit fc4c229142a68bc16c6a63cf3da3ce0e55ecb180
Author: Aaron Radzinzski <ar...@datalingvo.com>
AuthorDate: Thu May 28 19:05:52 2020 -0700
Misc. fixes.
---
.../org/apache/nlpcraft/model/tools/sqlgen/NCSqlExtractor.java | 2 +-
.../nlpcraft/model/tools/sqlgen/NCSqlModelGenerator.java | 10 +++++-----
.../model/tools/sqlgen/impl/NCSqlModelGeneratorImpl.scala | 9 ++++++---
3 files changed, 12 insertions(+), 9 deletions(-)
diff --git a/src/main/scala/org/apache/nlpcraft/model/tools/sqlgen/NCSqlExtractor.java b/src/main/scala/org/apache/nlpcraft/model/tools/sqlgen/NCSqlExtractor.java
index ebba87e..32b67ba 100644
--- a/src/main/scala/org/apache/nlpcraft/model/tools/sqlgen/NCSqlExtractor.java
+++ b/src/main/scala/org/apache/nlpcraft/model/tools/sqlgen/NCSqlExtractor.java
@@ -28,7 +28,7 @@ import java.util.List;
* <p>
* Note that {@link NCSqlExtractorBuilder} builder requires {@link NCSqlSchema} and {@link NCVariant}
* objects when creating an instance of SQL extractor. Methods in this interface will search
- * these parsing variant and schema to find necessary referenced tokens.
+ * the parsing variant and schema to find necessary referenced tokens.
* <p>
* Note also that wherever necessary the implementation will scan part (constituent) tokens as well
* (see {@link NCToken#findPartTokens(String...)} for more information).
diff --git a/src/main/scala/org/apache/nlpcraft/model/tools/sqlgen/NCSqlModelGenerator.java b/src/main/scala/org/apache/nlpcraft/model/tools/sqlgen/NCSqlModelGenerator.java
index b1ea2c7..b48cab5 100644
--- a/src/main/scala/org/apache/nlpcraft/model/tools/sqlgen/NCSqlModelGenerator.java
+++ b/src/main/scala/org/apache/nlpcraft/model/tools/sqlgen/NCSqlModelGenerator.java
@@ -28,21 +28,21 @@ import org.apache.nlpcraft.model.tools.sqlgen.impl.NCSqlModelGeneratorImpl;
* optional set of tables and columns for which it will generate YAML/JSON NLPCraft model stub. Run
* this class with <code>--help</code> parameter to get a full up-to-date documentation:
* <pre class="brush:plain">
- * java -cp apache-nlpcraft-x.x.x-all-deps.jar org.apache.nlpcraft.model.tools.sqlgen.NCSqlModelGenerator --help
+ * java -cp apache-nlpcraft-incubating-x.x.x-all-deps.jar org.apache.nlpcraft.model.tools.sqlgen.NCSqlModelGenerator --help
* </pre>
* <p>
* After the model stub is generated:
* <ul>
* <li>
+ * Load generated YAML/JSON-based model using {@link NCModelFileAdapter}
+ * class to instantiate model from this file.
+ * </li>
+ * <li>
* Modify and extend generated model stub to your own needs. In most cases, you'll need
* to add, remove or modify auto-generated synonyms, add intents, etc. Note, however, that generated model
* is fully complete and can be used as is.
* </li>
* <li>
- * Use generated YAML/JSON-based model together with {@link NCModelFileAdapter}
- * class to instantiate model from this file.
- * </li>
- * <li>
* Use {@link NCSqlSchemaBuilder#makeSchema(NCModel)} method to get an object representation of the
* SQL data schema for the model. You can use this object representation along with many utility
* methods in {@link NCSqlExtractor} class to efficiently auto-generate SQL queries against the source RDBMS.
diff --git a/src/main/scala/org/apache/nlpcraft/model/tools/sqlgen/impl/NCSqlModelGeneratorImpl.scala b/src/main/scala/org/apache/nlpcraft/model/tools/sqlgen/impl/NCSqlModelGeneratorImpl.scala
index 2450aaa..6a20a18 100644
--- a/src/main/scala/org/apache/nlpcraft/model/tools/sqlgen/impl/NCSqlModelGeneratorImpl.scala
+++ b/src/main/scala/org/apache/nlpcraft/model/tools/sqlgen/impl/NCSqlModelGeneratorImpl.scala
@@ -30,6 +30,7 @@ import com.fasterxml.jackson.dataformat.yaml.YAMLFactory
import com.fasterxml.jackson.dataformat.yaml.YAMLGenerator.Feature
import org.apache.nlpcraft.common.ascii.NCAsciiTable
import org.apache.nlpcraft.common.nlp.core.NCNlpPorterStemmer
+import org.apache.nlpcraft.common.version.NCVersion
import org.apache.nlpcraft.model.impl.json.{NCElementJson, NCMacroJson, NCModelJson}
import org.apache.nlpcraft.model.tools.sqlgen.NCSqlJoinType
import resource.managed
@@ -85,7 +86,7 @@ object NCSqlModelGeneratorImpl {
else
s"{${substituteMacros(elmNameLc)}|${substituteMacros(removeSeqDups(nameWs))}}"
}
-
+
case class ParametersHolder(
var cmdLine: String = null,
var url: String = null,
@@ -118,6 +119,8 @@ object NCSqlModelGeneratorImpl {
}
}
+ final private val ver = NCVersion.getCurrent
+
/**
*
* @param s
@@ -602,7 +605,7 @@ object NCSqlModelGeneratorImpl {
| NCSqlModelGenerator -- NLPCraft model generator for SQL databases.
|
|SYNOPSIS:
- | java -cp apache-nlpcraft-x.x.x-all-deps.jar org.apache.nlpcraft.model.tools.sqlgen.NCSqlModelGenerator [PARAMETERS]
+ | java -cp apache-nlpcraft-incubating-${ver.version}-all-deps.jar org.apache.nlpcraft.model.tools.sqlgen.NCSqlModelGenerator [PARAMETERS]
|
|DESCRIPTION:
| This utility generates NLPCraft model stub for a given SQL database schema. You
@@ -706,7 +709,7 @@ object NCSqlModelGeneratorImpl {
| do not start with '_'.
|
|EXAMPLES:
- | java -cp apache-nlpcraft-x.x.x-all-deps.jar org.apache.nlpcraft.model.tools.sqlgen.NCSqlModelGenerator
+ | java -cp apache-nlpcraft-incubating-${ver.version}-all-deps.jar org.apache.nlpcraft.model.tools.sqlgen.NCSqlModelGenerator
| -r jdbc:postgresql://localhost:5432/mydb
| -d org.postgresql.Driver
| -f "tbl_, col_"