This is an automated email from the ASF dual-hosted git repository. aradzinski pushed a commit to branch NLPCRAFT-206 in repository https://gitbox.apache.org/repos/asf/incubator-nlpcraft.git
commit eb07ce04633005de65573f2849d67fce162431db Author: Aaron Radzinski <[email protected]> AuthorDate: Thu Mar 18 11:51:20 2021 -0700 DSL -> IDL. --- README.md | 4 +- .../nlpcraft/common/makro/NCMacroCompiler.scala | 2 +- .../nlpcraft/common/makro/antlr4/NCMacroDsl.g4 | 4 +- .../nlpcraft/common/makro/antlr4/NCMacroDsl.interp | 2 +- .../nlpcraft/common/makro/antlr4/NCMacroDsl.tokens | 2 +- .../common/makro/antlr4/NCMacroDslLexer.interp | 6 +-- .../common/makro/antlr4/NCMacroDslLexer.java | 45 +++++++++++----------- .../common/makro/antlr4/NCMacroDslLexer.tokens | 2 +- .../common/makro/antlr4/NCMacroDslParser.java | 12 +++--- .../org/apache/nlpcraft/common/util/NCUtils.scala | 2 +- .../apache/nlpcraft/examples/phone/PhoneModel.java | 1 - .../nlpcraft/examples/weather/WeatherModel.java | 3 -- .../scala/org/apache/nlpcraft/model/NCIntent.java | 6 +-- .../org/apache/nlpcraft/model/NCIntentSkip.java | 2 +- .../org/apache/nlpcraft/model/NCModelView.java | 2 +- .../scala/org/apache/nlpcraft/model/NCToken.java | 2 +- .../nlpcraft/model/NCTokenPredicateContext.java | 2 +- .../nlpcraft/model/NCTokenPredicateResult.java | 2 +- .../apache/nlpcraft/model/intent/NCIdlTerm.scala | 10 +++-- .../model/intent/compiler/NCIdlCompiler.scala | 6 +-- .../nlpcraft/probe/mgrs/NCProbeSynonym.scala | 12 +++--- .../nlpcraft/probe/mgrs/NCProbeSynonymChunk.scala | 8 ++-- .../probe/mgrs/NCProbeSynonymChunkKind.scala | 2 +- .../probe/mgrs/deploy/NCDeployManager.scala | 26 ++++++------- .../probe/mgrs/nlp/NCProbeEnrichmentManager.scala | 2 +- .../mgrs/nlp/enrichers/model/NCModelEnricher.scala | 4 +- .../apache/nlpcraft/model/NCIntentDslSpec.scala | 6 +-- .../apache/nlpcraft/model/NCIntentDslSpec2.scala | 6 +-- .../model/intent/dsl/NCIntentDslTestModel.scala | 2 +- .../model/intent/dsl/NCIntentDslTestSpec.scala | 2 +- .../intent/dsl/compiler/NCIdlCompilerSpec.scala | 2 +- .../nlpcraft/model/intent/dsl/dsl_test_model.yaml | 4 +- .../nlpcraft/server/rest/NCRestAskSpec.scala | 2 +- .../nlpcraft/server/rest/NCRestCompanySpec.scala | 2 +- .../nlpcraft/server/rest/NCRestModelSpec.scala | 2 +- 35 files changed, 99 insertions(+), 100 deletions(-) diff --git a/README.md b/README.md index 4d8c8c7..34830e0 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ There is no learning curve, no special rules or UI to master, no cumbersome synt ## Key Features ### Programmable Intents -Fully programmable, advanced intent DSL with deterministic matching provides easy to use and expressive mechanism for a complex intent logic. +Fully programmable, advanced NLPCraft IDL (Intent Definition Language) with deterministic matching provides easy to use and expressive mechanism for a complex intent logic. ### Short-Term-Memory Advanced out-of-the-box support for maintaining and managing conversational context that is fully integrated with intent matching. @@ -53,7 +53,7 @@ NLPCraft focuses on processing English language delivering the ease of use and u Built with a singular focus - provide developers with unprecedented productivity and efficiency when building modern NLI applications. ### Composable Named Entities -Compose new reusable Named Entities out of existing internal or external ones, build new ones and mix and match using comprehensive DSL. +Compose new reusable Named Entities out of existing internal or external ones, build new ones and mix and match using comprehensive NLPCraft IDL. ### Java-First REST API and Java-based implementation natively supports the world's largest ecosystem of development tools, multiple programming languages, frameworks and services. diff --git a/nlpcraft/src/main/scala/org/apache/nlpcraft/common/makro/NCMacroCompiler.scala b/nlpcraft/src/main/scala/org/apache/nlpcraft/common/makro/NCMacroCompiler.scala index dcceda7..16ff67f 100644 --- a/nlpcraft/src/main/scala/org/apache/nlpcraft/common/makro/NCMacroCompiler.scala +++ b/nlpcraft/src/main/scala/org/apache/nlpcraft/common/makro/NCMacroCompiler.scala @@ -165,7 +165,7 @@ object NCMacroCompiler extends LazyLogging { val syn = ( if (ctx.TXT() != null) ctx.TXT() else if (ctx.REGEX_TXT() != null) ctx.REGEX_TXT() - else ctx.DSL_TXT() + else ctx.IDL_TXT() ).getText val buf = stack.top.buffer diff --git a/nlpcraft/src/main/scala/org/apache/nlpcraft/common/makro/antlr4/NCMacroDsl.g4 b/nlpcraft/src/main/scala/org/apache/nlpcraft/common/makro/antlr4/NCMacroDsl.g4 index 679ba01..4f21797 100644 --- a/nlpcraft/src/main/scala/org/apache/nlpcraft/common/makro/antlr4/NCMacroDsl.g4 +++ b/nlpcraft/src/main/scala/org/apache/nlpcraft/common/makro/antlr4/NCMacroDsl.g4 @@ -24,7 +24,7 @@ expr | expr item ; item: syn | group; -syn : (TXT | REGEX_TXT | DSL_TXT); +syn : (TXT | REGEX_TXT | IDL_TXT); group: LCURLY list RCURLY MINMAX?; list : expr @@ -66,7 +66,7 @@ fragment TXT_CHAR ; // Ignoring ['\u10000-'\uEFFFF]. MINMAX: '[' [ 0-9,]+ ']'; REGEX_TXT: '//' .*? '//'; -DSL_TXT: '^^' .*? '^^'; +IDL_TXT: '^^' .*? '^^'; TXT: (TXT_CHAR | ESC)+; WS: [ \r\t\u000C\n]+ -> skip ; ERR_CHAR: .; \ No newline at end of file diff --git a/nlpcraft/src/main/scala/org/apache/nlpcraft/common/makro/antlr4/NCMacroDsl.interp b/nlpcraft/src/main/scala/org/apache/nlpcraft/common/makro/antlr4/NCMacroDsl.interp index d8e6b6a..6f2c738 100644 --- a/nlpcraft/src/main/scala/org/apache/nlpcraft/common/makro/antlr4/NCMacroDsl.interp +++ b/nlpcraft/src/main/scala/org/apache/nlpcraft/common/makro/antlr4/NCMacroDsl.interp @@ -21,7 +21,7 @@ COMMA UNDERSCORE MINMAX REGEX_TXT -DSL_TXT +IDL_TXT TXT WS ERR_CHAR diff --git a/nlpcraft/src/main/scala/org/apache/nlpcraft/common/makro/antlr4/NCMacroDsl.tokens b/nlpcraft/src/main/scala/org/apache/nlpcraft/common/makro/antlr4/NCMacroDsl.tokens index 4a59220..7ef9fd0 100644 --- a/nlpcraft/src/main/scala/org/apache/nlpcraft/common/makro/antlr4/NCMacroDsl.tokens +++ b/nlpcraft/src/main/scala/org/apache/nlpcraft/common/makro/antlr4/NCMacroDsl.tokens @@ -5,7 +5,7 @@ COMMA=4 UNDERSCORE=5 MINMAX=6 REGEX_TXT=7 -DSL_TXT=8 +IDL_TXT=8 TXT=9 WS=10 ERR_CHAR=11 diff --git a/nlpcraft/src/main/scala/org/apache/nlpcraft/common/makro/antlr4/NCMacroDslLexer.interp b/nlpcraft/src/main/scala/org/apache/nlpcraft/common/makro/antlr4/NCMacroDslLexer.interp index c069131..c9ab8a3 100644 --- a/nlpcraft/src/main/scala/org/apache/nlpcraft/common/makro/antlr4/NCMacroDslLexer.interp +++ b/nlpcraft/src/main/scala/org/apache/nlpcraft/common/makro/antlr4/NCMacroDslLexer.interp @@ -21,7 +21,7 @@ COMMA UNDERSCORE MINMAX REGEX_TXT -DSL_TXT +IDL_TXT TXT WS ERR_CHAR @@ -37,7 +37,7 @@ ESC TXT_CHAR MINMAX REGEX_TXT -DSL_TXT +IDL_TXT TXT WS ERR_CHAR @@ -50,4 +50,4 @@ mode names: DEFAULT_MODE atn: -[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 2, 13, 96, 8, 1, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 3, 2, 3, 2, 3, 3, 3, 3, 3, 4, 3, 4, 3, 5, 3, 5, 3, 6, 3, 6, 3, 7, 3, 7, 3, 8, 3, 8, 3, 8, 3, 9, 5, 9, 48, 10, 9, 3, 10, 3, 10, 6, 10, 52, 10, 10, 13, 10, 14, 10, 53, 3, 10, 3, 10, 3, 11, 3, 11, 3, 11, 3, 11, 7, 11, 62, 10, 11, 12, 11, [...] \ No newline at end of file +[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 2, 13, 96, 8, 1, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 3, 2, 3, 2, 3, 3, 3, 3, 3, 4, 3, 4, 3, 5, 3, 5, 3, 6, 3, 6, 3, 7, 3, 7, 3, 8, 3, 8, 3, 8, 3, 9, 5, 9, 48, 10, 9, 3, 10, 3, 10, 6, 10, 52, 10, 10, 13, 10, 14, 10, 53, 3, 10, 3, 10, 3, 11, 3, 11, 3, 11, 3, 11, 7, 11, 62, 10, 11, 12, 11, [...] \ No newline at end of file diff --git a/nlpcraft/src/main/scala/org/apache/nlpcraft/common/makro/antlr4/NCMacroDslLexer.java b/nlpcraft/src/main/scala/org/apache/nlpcraft/common/makro/antlr4/NCMacroDslLexer.java index 40885d5..e2d9665 100644 --- a/nlpcraft/src/main/scala/org/apache/nlpcraft/common/makro/antlr4/NCMacroDslLexer.java +++ b/nlpcraft/src/main/scala/org/apache/nlpcraft/common/makro/antlr4/NCMacroDslLexer.java @@ -18,7 +18,7 @@ public class NCMacroDslLexer extends Lexer { new PredictionContextCache(); public static final int LCURLY=1, RCURLY=2, VERT=3, COMMA=4, UNDERSCORE=5, MINMAX=6, REGEX_TXT=7, - DSL_TXT=8, TXT=9, WS=10, ERR_CHAR=11; + IDL_TXT=8, TXT=9, WS=10, ERR_CHAR=11; public static String[] channelNames = { "DEFAULT_TOKEN_CHANNEL", "HIDDEN" }; @@ -30,7 +30,7 @@ public class NCMacroDslLexer extends Lexer { private static String[] makeRuleNames() { return new String[] { "LCURLY", "RCURLY", "VERT", "COMMA", "UNDERSCORE", "ESC_CHAR", "ESC", - "TXT_CHAR", "MINMAX", "REGEX_TXT", "DSL_TXT", "TXT", "WS", "ERR_CHAR" + "TXT_CHAR", "MINMAX", "REGEX_TXT", "IDL_TXT", "TXT", "WS", "ERR_CHAR" }; } public static final String[] ruleNames = makeRuleNames(); @@ -44,7 +44,7 @@ public class NCMacroDslLexer extends Lexer { private static String[] makeSymbolicNames() { return new String[] { null, "LCURLY", "RCURLY", "VERT", "COMMA", "UNDERSCORE", "MINMAX", "REGEX_TXT", - "DSL_TXT", "TXT", "WS", "ERR_CHAR" + "IDL_TXT", "TXT", "WS", "ERR_CHAR" }; } private static final String[] _SYMBOLIC_NAMES = makeSymbolicNames(); @@ -114,25 +114,26 @@ public class NCMacroDslLexer extends Lexer { "\13\3\13\3\f\3\f\3\f\3\f\7\fJ\n\f\f\f\16\fM\13\f\3\f\3\f\3\f\3\r\3\r\6"+ "\rT\n\r\r\r\16\rU\3\16\6\16Y\n\16\r\16\16\16Z\3\16\3\16\3\17\3\17\4?K"+ "\2\20\3\3\5\4\7\5\t\6\13\7\r\2\17\2\21\2\23\b\25\t\27\n\31\13\33\f\35"+ - "\r\3\2\6\6\2..]_aa}\177\17\2#@B\\^^`|\u0080\u0080\u00a2\u2001\u200e\u200f"+ - "\u2041\u2042\u2072\u2191\u2c02\u2ff1\u3003\ud801\uf902\ufdd1\ufdf2\uffff"+ - "\5\2\"\"..\62;\5\2\13\f\16\17\"\"\2b\2\3\3\2\2\2\2\5\3\2\2\2\2\7\3\2\2"+ - "\2\2\t\3\2\2\2\2\13\3\2\2\2\2\23\3\2\2\2\2\25\3\2\2\2\2\27\3\2\2\2\2\31"+ - "\3\2\2\2\2\33\3\2\2\2\2\35\3\2\2\2\3\37\3\2\2\2\5!\3\2\2\2\7#\3\2\2\2"+ - "\t%\3\2\2\2\13\'\3\2\2\2\r)\3\2\2\2\17+\3\2\2\2\21/\3\2\2\2\23\61\3\2"+ - "\2\2\259\3\2\2\2\27E\3\2\2\2\31S\3\2\2\2\33X\3\2\2\2\35^\3\2\2\2\37 \7"+ - "}\2\2 \4\3\2\2\2!\"\7\177\2\2\"\6\3\2\2\2#$\7~\2\2$\b\3\2\2\2%&\7.\2\2"+ - "&\n\3\2\2\2\'(\7a\2\2(\f\3\2\2\2)*\t\2\2\2*\16\3\2\2\2+,\7^\2\2,-\5\r"+ - "\7\2-\20\3\2\2\2.\60\t\3\2\2/.\3\2\2\2\60\22\3\2\2\2\61\63\7]\2\2\62\64"+ - "\t\4\2\2\63\62\3\2\2\2\64\65\3\2\2\2\65\63\3\2\2\2\65\66\3\2\2\2\66\67"+ - "\3\2\2\2\678\7_\2\28\24\3\2\2\29:\7\61\2\2:;\7\61\2\2;?\3\2\2\2<>\13\2"+ - "\2\2=<\3\2\2\2>A\3\2\2\2?@\3\2\2\2?=\3\2\2\2@B\3\2\2\2A?\3\2\2\2BC\7\61"+ - "\2\2CD\7\61\2\2D\26\3\2\2\2EF\7`\2\2FG\7`\2\2GK\3\2\2\2HJ\13\2\2\2IH\3"+ - "\2\2\2JM\3\2\2\2KL\3\2\2\2KI\3\2\2\2LN\3\2\2\2MK\3\2\2\2NO\7`\2\2OP\7"+ - "`\2\2P\30\3\2\2\2QT\5\21\t\2RT\5\17\b\2SQ\3\2\2\2SR\3\2\2\2TU\3\2\2\2"+ - "US\3\2\2\2UV\3\2\2\2V\32\3\2\2\2WY\t\5\2\2XW\3\2\2\2YZ\3\2\2\2ZX\3\2\2"+ - "\2Z[\3\2\2\2[\\\3\2\2\2\\]\b\16\2\2]\34\3\2\2\2^_\13\2\2\2_\36\3\2\2\2"+ - "\n\2/\65?KSUZ\3\b\2\2"; + "\r\3\2\6\6\2..]_aa}\177\24\2#@B\\^^`|\u0080\u0080\u00a2\u0251\u025b\u0294"+ + "\u02b2\u0371\u0402\u0501\u1e04\u1ef5\u1f03\u2001\u200e\u200f\u2041\u2042"+ + "\u2072\u2191\u2c02\u2ff1\u3003\ud801\uf902\ufdd1\ufdf2\uffff\5\2\"\"."+ + ".\62;\5\2\13\f\16\17\"\"\2b\2\3\3\2\2\2\2\5\3\2\2\2\2\7\3\2\2\2\2\t\3"+ + "\2\2\2\2\13\3\2\2\2\2\23\3\2\2\2\2\25\3\2\2\2\2\27\3\2\2\2\2\31\3\2\2"+ + "\2\2\33\3\2\2\2\2\35\3\2\2\2\3\37\3\2\2\2\5!\3\2\2\2\7#\3\2\2\2\t%\3\2"+ + "\2\2\13\'\3\2\2\2\r)\3\2\2\2\17+\3\2\2\2\21/\3\2\2\2\23\61\3\2\2\2\25"+ + "9\3\2\2\2\27E\3\2\2\2\31S\3\2\2\2\33X\3\2\2\2\35^\3\2\2\2\37 \7}\2\2 "+ + "\4\3\2\2\2!\"\7\177\2\2\"\6\3\2\2\2#$\7~\2\2$\b\3\2\2\2%&\7.\2\2&\n\3"+ + "\2\2\2\'(\7a\2\2(\f\3\2\2\2)*\t\2\2\2*\16\3\2\2\2+,\7^\2\2,-\5\r\7\2-"+ + "\20\3\2\2\2.\60\t\3\2\2/.\3\2\2\2\60\22\3\2\2\2\61\63\7]\2\2\62\64\t\4"+ + "\2\2\63\62\3\2\2\2\64\65\3\2\2\2\65\63\3\2\2\2\65\66\3\2\2\2\66\67\3\2"+ + "\2\2\678\7_\2\28\24\3\2\2\29:\7\61\2\2:;\7\61\2\2;?\3\2\2\2<>\13\2\2\2"+ + "=<\3\2\2\2>A\3\2\2\2?@\3\2\2\2?=\3\2\2\2@B\3\2\2\2A?\3\2\2\2BC\7\61\2"+ + "\2CD\7\61\2\2D\26\3\2\2\2EF\7`\2\2FG\7`\2\2GK\3\2\2\2HJ\13\2\2\2IH\3\2"+ + "\2\2JM\3\2\2\2KL\3\2\2\2KI\3\2\2\2LN\3\2\2\2MK\3\2\2\2NO\7`\2\2OP\7`\2"+ + "\2P\30\3\2\2\2QT\5\21\t\2RT\5\17\b\2SQ\3\2\2\2SR\3\2\2\2TU\3\2\2\2US\3"+ + "\2\2\2UV\3\2\2\2V\32\3\2\2\2WY\t\5\2\2XW\3\2\2\2YZ\3\2\2\2ZX\3\2\2\2Z"+ + "[\3\2\2\2[\\\3\2\2\2\\]\b\16\2\2]\34\3\2\2\2^_\13\2\2\2_\36\3\2\2\2\n"+ + "\2/\65?KSUZ\3\b\2\2"; public static final ATN _ATN = new ATNDeserializer().deserialize(_serializedATN.toCharArray()); static { diff --git a/nlpcraft/src/main/scala/org/apache/nlpcraft/common/makro/antlr4/NCMacroDslLexer.tokens b/nlpcraft/src/main/scala/org/apache/nlpcraft/common/makro/antlr4/NCMacroDslLexer.tokens index 4a59220..7ef9fd0 100644 --- a/nlpcraft/src/main/scala/org/apache/nlpcraft/common/makro/antlr4/NCMacroDslLexer.tokens +++ b/nlpcraft/src/main/scala/org/apache/nlpcraft/common/makro/antlr4/NCMacroDslLexer.tokens @@ -5,7 +5,7 @@ COMMA=4 UNDERSCORE=5 MINMAX=6 REGEX_TXT=7 -DSL_TXT=8 +IDL_TXT=8 TXT=9 WS=10 ERR_CHAR=11 diff --git a/nlpcraft/src/main/scala/org/apache/nlpcraft/common/makro/antlr4/NCMacroDslParser.java b/nlpcraft/src/main/scala/org/apache/nlpcraft/common/makro/antlr4/NCMacroDslParser.java index 626f67d..b0ce4f5 100644 --- a/nlpcraft/src/main/scala/org/apache/nlpcraft/common/makro/antlr4/NCMacroDslParser.java +++ b/nlpcraft/src/main/scala/org/apache/nlpcraft/common/makro/antlr4/NCMacroDslParser.java @@ -18,7 +18,7 @@ public class NCMacroDslParser extends Parser { new PredictionContextCache(); public static final int LCURLY=1, RCURLY=2, VERT=3, COMMA=4, UNDERSCORE=5, MINMAX=6, REGEX_TXT=7, - DSL_TXT=8, TXT=9, WS=10, ERR_CHAR=11; + IDL_TXT=8, TXT=9, WS=10, ERR_CHAR=11; public static final int RULE_makro = 0, RULE_expr = 1, RULE_item = 2, RULE_syn = 3, RULE_group = 4, RULE_list = 5; @@ -38,7 +38,7 @@ public class NCMacroDslParser extends Parser { private static String[] makeSymbolicNames() { return new String[] { null, "LCURLY", "RCURLY", "VERT", "COMMA", "UNDERSCORE", "MINMAX", "REGEX_TXT", - "DSL_TXT", "TXT", "WS", "ERR_CHAR" + "IDL_TXT", "TXT", "WS", "ERR_CHAR" }; } private static final String[] _SYMBOLIC_NAMES = makeSymbolicNames(); @@ -239,7 +239,7 @@ public class NCMacroDslParser extends Parser { _errHandler.sync(this); switch (_input.LA(1)) { case REGEX_TXT: - case DSL_TXT: + case IDL_TXT: case TXT: enterOuterAlt(_localctx, 1); { @@ -272,7 +272,7 @@ public class NCMacroDslParser extends Parser { public static class SynContext extends ParserRuleContext { public TerminalNode TXT() { return getToken(NCMacroDslParser.TXT, 0); } public TerminalNode REGEX_TXT() { return getToken(NCMacroDslParser.REGEX_TXT, 0); } - public TerminalNode DSL_TXT() { return getToken(NCMacroDslParser.DSL_TXT, 0); } + public TerminalNode IDL_TXT() { return getToken(NCMacroDslParser.IDL_TXT, 0); } public SynContext(ParserRuleContext parent, int invokingState) { super(parent, invokingState); } @@ -296,7 +296,7 @@ public class NCMacroDslParser extends Parser { { setState(29); _la = _input.LA(1); - if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << REGEX_TXT) | (1L << DSL_TXT) | (1L << TXT))) != 0)) ) { + if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << REGEX_TXT) | (1L << IDL_TXT) | (1L << TXT))) != 0)) ) { _errHandler.recoverInline(this); } else { @@ -416,7 +416,7 @@ public class NCMacroDslParser extends Parser { switch (_input.LA(1)) { case LCURLY: case REGEX_TXT: - case DSL_TXT: + case IDL_TXT: case TXT: { setState(38); diff --git a/nlpcraft/src/main/scala/org/apache/nlpcraft/common/util/NCUtils.scala b/nlpcraft/src/main/scala/org/apache/nlpcraft/common/util/NCUtils.scala index f96acca..46bd6ea 100644 --- a/nlpcraft/src/main/scala/org/apache/nlpcraft/common/util/NCUtils.scala +++ b/nlpcraft/src/main/scala/org/apache/nlpcraft/common/util/NCUtils.scala @@ -75,7 +75,7 @@ object NCUtils extends LazyLogging { private final val ANSI_SEQ = Pattern.compile("\u001B\\[[?;\\d]*[a-zA-Z]") final val REGEX_FIX = "//" - final val DSL_FIX = "^^" + final val IDL_FIX = "^^" final val DFLT_PROBE_TOKEN = "3141592653589793" diff --git a/nlpcraft/src/main/scala/org/apache/nlpcraft/examples/phone/PhoneModel.java b/nlpcraft/src/main/scala/org/apache/nlpcraft/examples/phone/PhoneModel.java index 340b086..bafd428 100644 --- a/nlpcraft/src/main/scala/org/apache/nlpcraft/examples/phone/PhoneModel.java +++ b/nlpcraft/src/main/scala/org/apache/nlpcraft/examples/phone/PhoneModel.java @@ -29,7 +29,6 @@ import java.util.stream.*; * <p> * Note that this example is using NE tokens from Google Natural Language service. 'google' provider should * be enabled to run this example - see 'tokenProviders' section in server configuration. - * Note also that this example is using class-based intent DSL (to demonstrate its usage). * <p> * See 'README.md' file in the same folder for running and testing instructions. */ diff --git a/nlpcraft/src/main/scala/org/apache/nlpcraft/examples/weather/WeatherModel.java b/nlpcraft/src/main/scala/org/apache/nlpcraft/examples/weather/WeatherModel.java index e706494..34b2065 100644 --- a/nlpcraft/src/main/scala/org/apache/nlpcraft/examples/weather/WeatherModel.java +++ b/nlpcraft/src/main/scala/org/apache/nlpcraft/examples/weather/WeatherModel.java @@ -37,9 +37,6 @@ import static java.time.temporal.ChronoUnit.DAYS; * intent matching logic. It uses Apple's Dark Sky API weather provider REST service for the actual * weather information (https://darksky.net/dev/docs#overview) * <p> - * Note that this example uses class-based intent DSL to demonstrate its usage pattern. - * Note also that it also returns intent ID together with execution result which can be used in testing. - * <p> * See 'README.md' file in the same folder for running and testing instructions. */ public class WeatherModel extends NCModelFileAdapter { diff --git a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/NCIntent.java b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/NCIntent.java index 14ecc1d..79438ea 100644 --- a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/NCIntent.java +++ b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/NCIntent.java @@ -24,7 +24,7 @@ import static java.lang.annotation.RetentionPolicy.*; /** * Annotation to bind an intent with the method serving as its callback. This annotation takes a string value - * that defines an intent via intent DSL. This annotation can also be applied to a model's class in + * that defines an intent via IDL. This annotation can also be applied to a model's class in * which case it will just declare the intent without binding it and the callback method will need to * use {@link NCIntentRef} annotation to actually bind it to the declared intent. Note that multiple intents * can be bound to the same callback method, but only one callback method can be bound with a given intent. @@ -45,9 +45,9 @@ import static java.lang.annotation.RetentionPolicy.*; @Repeatable(NCIntent.NCIntentList.class) public @interface NCIntent { /** - * Intent specification using intent DSL. + * Intent specification using IDL. * - * @return Intent specification using intent DSL. + * @return Intent specification using IDL. */ String value() default ""; diff --git a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/NCIntentSkip.java b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/NCIntentSkip.java index b196632..6d48d3c 100644 --- a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/NCIntentSkip.java +++ b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/NCIntentSkip.java @@ -26,7 +26,7 @@ import org.apache.nlpcraft.common.*; * will be selected and its callback will be called. * <p> * This exception becomes useful when it is hard or impossible to encode the entire matching logic using just - * declarative intent DSL. In these cases the intent definition can be relaxed and the "last mile" of intent + * declarative IDL. In these cases the intent definition can be relaxed and the "last mile" of intent * matching can happen inside of the intent callback's user logic. If it is determined that intent in fact does * not match then throwing this exception allows to try next best matching intent, if any. * <p> diff --git a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/NCModelView.java b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/NCModelView.java index eb46489..8f9849a 100644 --- a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/NCModelView.java +++ b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/NCModelView.java @@ -956,7 +956,7 @@ public interface NCModelView extends NCMetadata { * Gets optional user-defined model element parsers for custom NER implementations. Note that order of the parsers * is important as they will be invoked in the same order they are returned. * <p> - * By default, the data model detects its elements by their synonyms, regexp or DSL expressions. However, + * By default, the data model detects its elements by their synonyms, regexp or IDL expressions. However, * in some cases these methods are not expressive enough. In such cases, a user-defined parser can be defined * for the model that would allow the user to define its own NER logic to detect the model elements in the user * input programmatically. Note that a single parser can detect any number of model elements. diff --git a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/NCToken.java b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/NCToken.java index 136516a..a362992 100644 --- a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/NCToken.java +++ b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/NCToken.java @@ -160,7 +160,7 @@ public interface NCToken extends NCMetadata { /** * Gets optional set of aliases this token is known by. Token can get an alias if it is a part of - * other composed token and token DSL expression that was used to match it specified an alias. Note + * other composed token and IDL expression that was used to match it specified an alias. Note * that token can have zero, one or more aliases. * * @return List of aliases this token is known by. Can be empty, but never {@code null}. diff --git a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/NCTokenPredicateContext.java b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/NCTokenPredicateContext.java index 1448800..2841e23 100644 --- a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/NCTokenPredicateContext.java +++ b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/NCTokenPredicateContext.java @@ -21,7 +21,7 @@ import java.util.Optional; /** * Context passed into custom user-defined token predicate. Custom token predicates can be used in - * intent and synonym DSL. + * intent IDL. * <p> * Read full documentation in <a target=_ href="https://nlpcraft.apache.org/intent-matching.html">Intent Matching</a> section and review * <a target=_ href="https://github.com/apache/incubator-nlpcraft/tree/master/nlpcraft/src/main/scala/org/apache/nlpcraft/examples/">examples</a>. diff --git a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/NCTokenPredicateResult.java b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/NCTokenPredicateResult.java index 5b2fbb7..b6a3e17 100644 --- a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/NCTokenPredicateResult.java +++ b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/NCTokenPredicateResult.java @@ -18,7 +18,7 @@ package org.apache.nlpcraft.model; /** - * Result value of user-defined token predicate. Token predicates can be used in intent and synonym DSL. + * Result value of user-defined token predicate. Token predicates can be used in intent IDL. * <p> * Read full documentation in <a target=_ href="https://nlpcraft.apache.org/intent-matching.html">Intent Matching</a> section and review * <a target=_ href="https://github.com/apache/incubator-nlpcraft/tree/master/nlpcraft/src/main/scala/org/apache/nlpcraft/examples/">examples</a>. diff --git a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/NCIdlTerm.scala b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/NCIdlTerm.scala index 6ef71d6..6805d17 100644 --- a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/NCIdlTerm.scala +++ b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/NCIdlTerm.scala @@ -20,16 +20,18 @@ package org.apache.nlpcraft.model.intent import org.apache.nlpcraft.common._ /** - * DSL term. + * IDL term. * + * @param idl * @param id Optional ID of this term. * @param pred * @param min * @param max * @param conv + * @param fragMeta */ case class NCIdlTerm( - dsl: String, + idl: String, id: Option[String], pred: NCIdlTokenPredicate, min: Int, @@ -47,7 +49,7 @@ case class NCIdlTerm( */ def cloneWithFragMeta(meta: Map[String, Any]): NCIdlTerm = NCIdlTerm( - dsl, + idl, id, pred, min, @@ -56,5 +58,5 @@ case class NCIdlTerm( meta ) - override def toString: String = g(dsl) + override def toString: String = g(idl) } diff --git a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/compiler/NCIdlCompiler.scala b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/compiler/NCIdlCompiler.scala index 720b681..3124573 100644 --- a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/compiler/NCIdlCompiler.scala +++ b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/compiler/NCIdlCompiler.scala @@ -288,7 +288,7 @@ object NCIdlCompiler extends LazyLogging { } } } - else // DSL-defined term. + else // IDL term. instrToPredicate("Intent term")(ctx.expr()) // Add term. @@ -361,7 +361,7 @@ object NCIdlCompiler extends LazyLogging { val x = U.trimQuotes(ctx.qstring().getText) if (Global.hasImport(x)) - logger.warn(s"Ignoring already processed DSL import '$x' in: $origin") + logger.warn(s"Ignoring already processed IDL import '$x' in: $origin") else { Global.addImport(x) @@ -521,7 +521,7 @@ object NCIdlCompiler extends LazyLogging { * * @param dsl * @param mdl - * @param origin DSL origin. + * @param origin IDL origin. */ class CompilerErrorListener(dsl: String, mdl: NCModel, origin: String) extends BaseErrorListener { /** diff --git a/nlpcraft/src/main/scala/org/apache/nlpcraft/probe/mgrs/NCProbeSynonym.scala b/nlpcraft/src/main/scala/org/apache/nlpcraft/probe/mgrs/NCProbeSynonym.scala index 910a27e..9b56deb 100644 --- a/nlpcraft/src/main/scala/org/apache/nlpcraft/probe/mgrs/NCProbeSynonym.scala +++ b/nlpcraft/src/main/scala/org/apache/nlpcraft/probe/mgrs/NCProbeSynonym.scala @@ -45,7 +45,7 @@ class NCProbeSynonym( lazy val isTextOnly: Boolean = forall(_.kind == TEXT) lazy val regexChunks: Int = count(_.kind == REGEX) - lazy val dslChunks: Int = count(_.kind == DSL) + lazy val dslChunks: Int = count(_.kind == IDL) lazy val isValueSynonym: Boolean = value != null lazy val stems: String = map(_.wordStem).mkString(" ") lazy val stemsHash: Int = stems.hashCode @@ -58,7 +58,7 @@ class NCProbeSynonym( private def getSort(kind: NCSynonymChunkKind): Int = kind match { case TEXT ⇒ 0 - case DSL ⇒ 1 + case IDL ⇒ 1 case REGEX ⇒ 2 case _ ⇒ throw new AssertionError(s"Unexpected kind: $kind") } @@ -83,7 +83,7 @@ class NCProbeSynonym( val regex = chunk.regex regex.matcher(tok.origText).matches() || regex.matcher(tok.normText).matches() - case DSL ⇒ throw new AssertionError() + case IDL ⇒ throw new AssertionError() case _ ⇒ throw new AssertionError() } } @@ -116,8 +116,8 @@ class NCProbeSynonym( r.matcher(get0(_.origText, _.origText)).matches() || r.matcher(get0(_.normText, _.normText)).matches() - case DSL ⇒ - get0(t ⇒ chunk.dslPred.apply(t, NCIdlContext(req = req))._1, _ ⇒ false) + case IDL ⇒ + get0(t ⇒ chunk.idlPred.apply(t, NCIdlContext(req = req))._1, _ ⇒ false) case _ ⇒ throw new AssertionError() } @@ -165,7 +165,7 @@ class NCProbeSynonym( val thisDynCnt = regexChunks + dslChunks val thatDynCnt = that.regexChunks + that.dslChunks - // Less PoS/regex/DSL chunks means less uncertainty, i.e. larger weight. + // Less PoS/regex/IDL chunks means less uncertainty, i.e. larger weight. if (thisDynCnt < thatDynCnt) 1 else if (thisDynCnt > thatDynCnt) diff --git a/nlpcraft/src/main/scala/org/apache/nlpcraft/probe/mgrs/NCProbeSynonymChunk.scala b/nlpcraft/src/main/scala/org/apache/nlpcraft/probe/mgrs/NCProbeSynonymChunk.scala index 7d17dc2..cefb16a 100644 --- a/nlpcraft/src/main/scala/org/apache/nlpcraft/probe/mgrs/NCProbeSynonymChunk.scala +++ b/nlpcraft/src/main/scala/org/apache/nlpcraft/probe/mgrs/NCProbeSynonymChunk.scala @@ -24,22 +24,22 @@ import java.util.regex.Pattern /** * - * @param alias Optional alias for this chunk from token DSL. + * @param alias Optional alias for this chunk from IDL. * @param kind Kind of synonym chunk. * @param origText Original text. * @param wordStem Optional stem for a single word synonyms. * @param posTag Optional PoS tag to match on. * @param regex Optional regex expression to match on. - * @param dslPred Optional DSL expression to match on. + * @param idlPred Optional IDL expression to match on. */ case class NCProbeSynonymChunk( - alias: String = null, // Not-null only for kind == DSL. + alias: String = null, // Not-null only for kind == IDL. kind: NCSynonymChunkKind, origText: String, wordStem: String = null, // Only for kind == TEXT. posTag: String = null, regex: Pattern = null, - dslPred: NCIdlTokenPredicate = null + idlPred: NCIdlTokenPredicate = null ) { require(origText != null) require(kind != null) diff --git a/nlpcraft/src/main/scala/org/apache/nlpcraft/probe/mgrs/NCProbeSynonymChunkKind.scala b/nlpcraft/src/main/scala/org/apache/nlpcraft/probe/mgrs/NCProbeSynonymChunkKind.scala index 9394d0f..73e4eaf 100644 --- a/nlpcraft/src/main/scala/org/apache/nlpcraft/probe/mgrs/NCProbeSynonymChunkKind.scala +++ b/nlpcraft/src/main/scala/org/apache/nlpcraft/probe/mgrs/NCProbeSynonymChunkKind.scala @@ -25,5 +25,5 @@ object NCProbeSynonymChunkKind extends Enumeration { val TEXT: Value = Value // Simple word. val REGEX: Value = Value // RegEx match expression (//[abd]+//). - val DSL: Value = Value // DSL match expression (^^id == 'nlpcraft:city'^^). + val IDL: Value = Value // IDL match expression (^^[alias]{id == 'nlpcraft:city'}^^). } diff --git a/nlpcraft/src/main/scala/org/apache/nlpcraft/probe/mgrs/deploy/NCDeployManager.scala b/nlpcraft/src/main/scala/org/apache/nlpcraft/probe/mgrs/deploy/NCDeployManager.scala index 4add91a..8357c6a 100644 --- a/nlpcraft/src/main/scala/org/apache/nlpcraft/probe/mgrs/deploy/NCDeployManager.scala +++ b/nlpcraft/src/main/scala/org/apache/nlpcraft/probe/mgrs/deploy/NCDeployManager.scala @@ -30,13 +30,13 @@ import org.apache.nlpcraft.common.ascii.NCAsciiTable import org.apache.nlpcraft.common.config.NCConfigurable import org.apache.nlpcraft.common.makro.NCMacroParser import org.apache.nlpcraft.common.nlp.core.{NCNlpCoreManager, NCNlpPorterStemmer} -import org.apache.nlpcraft.common.util.NCUtils.{DSL_FIX, REGEX_FIX} +import org.apache.nlpcraft.common.util.NCUtils.{IDL_FIX, REGEX_FIX} import org.apache.nlpcraft.model._ import org.apache.nlpcraft.model.factories.basic.NCBasicModelFactory import org.apache.nlpcraft.model.intent.compiler.NCIdlCompiler import org.apache.nlpcraft.model.intent.solver.NCIntentSolver import org.apache.nlpcraft.model.intent._ -import org.apache.nlpcraft.probe.mgrs.NCProbeSynonymChunkKind.{DSL, REGEX, TEXT} +import org.apache.nlpcraft.probe.mgrs.NCProbeSynonymChunkKind.{IDL, REGEX, TEXT} import org.apache.nlpcraft.probe.mgrs.{NCProbeModel, NCProbeSynonym, NCProbeSynonymChunk, NCProbeSynonymsWrapper} import resource.managed @@ -302,8 +302,8 @@ object NCDeployManager extends NCService with DecorateAsScala { while (curr < len) { if (isFix(REGEX_FIX)) processChunk(REGEX_FIX) - else if (isFix(DSL_FIX)) - processChunk(DSL_FIX) + else if (isFix(IDL_FIX)) + processChunk(IDL_FIX) else curr += 1 } @@ -418,18 +418,18 @@ object NCDeployManager extends NCService with DecorateAsScala { .flatten .toList - // Check for DSL alias uniqueness. + // Check for IDL alias uniqueness. if (U.containsDups(allAliases)) - throw new NCE(s"Duplicate DSL synonym alias found [" + + throw new NCE(s"Duplicate IDL synonym alias found [" + s"mdlId=$mdlId, " + s"dups=${allAliases.diff(allAliases.distinct).mkString(", ")}" + s"]") val idAliasDups = mdl.getElements.asScala.map(_.getId).intersect(allAliases.toSet) - // Check that DSL aliases don't intersect with element IDs. + // Check that IDL aliases don't intersect with element IDs. if (idAliasDups.nonEmpty) - throw new NCE(s"Model element IDs and DSL synonym aliases intersect [" + + throw new NCE(s"Model element IDs and IDL synonym aliases intersect [" + s"mdlId=$mdlId, " + s"dups=${idAliasDups.mkString(", ")}" + "]") @@ -956,7 +956,7 @@ object NCDeployManager extends NCService with DecorateAsScala { */ private def filter(set: mutable.HashSet[SynonymHolder], dsl: Boolean): Set[SynonymHolder] = set.toSet.filter(s ⇒ { - val b = s.syn.exists(_.kind == DSL) + val b = s.syn.exists(_.kind == IDL) if (dsl) b else !b }) @@ -993,12 +993,12 @@ object NCDeployManager extends NCService with DecorateAsScala { s"chunk=$chunk" + s"]") } - // DSL-based synonym. - else if (startsAndEnds(DSL_FIX, chunk)) { - val dsl = stripSuffix(DSL_FIX, chunk) + // IDL-based synonym. + else if (startsAndEnds(IDL_FIX, chunk)) { + val dsl = stripSuffix(IDL_FIX, chunk) val compUnit = NCIdlCompiler.compileSynonym(dsl, mdl, mdl.getOrigin) - val x = NCProbeSynonymChunk(alias = compUnit.alias.orNull, kind = DSL, origText = chunk, dslPred = compUnit.pred) + val x = NCProbeSynonymChunk(alias = compUnit.alias.orNull, kind = IDL, origText = chunk, idlPred = compUnit.pred) x } diff --git a/nlpcraft/src/main/scala/org/apache/nlpcraft/probe/mgrs/nlp/NCProbeEnrichmentManager.scala b/nlpcraft/src/main/scala/org/apache/nlpcraft/probe/mgrs/nlp/NCProbeEnrichmentManager.scala index d8c721d..03b49ed 100644 --- a/nlpcraft/src/main/scala/org/apache/nlpcraft/probe/mgrs/nlp/NCProbeEnrichmentManager.scala +++ b/nlpcraft/src/main/scala/org/apache/nlpcraft/probe/mgrs/nlp/NCProbeEnrichmentManager.scala @@ -483,7 +483,7 @@ object NCProbeEnrichmentManager extends NCService with NCOpenCensusModelStats { h.enricher → same }).toMap - // Loop has sense if model is complex (has user defined parsers or DSL based synonyms) + // Loop has sense if model is complex (has user defined parsers or IDL based synonyms) continue = NCModelEnricher.isComplex(mdl) && res.exists { case (_, same) ⇒ !same } if (DEEP_DEBUG) diff --git a/nlpcraft/src/main/scala/org/apache/nlpcraft/probe/mgrs/nlp/enrichers/model/NCModelEnricher.scala b/nlpcraft/src/main/scala/org/apache/nlpcraft/probe/mgrs/nlp/enrichers/model/NCModelEnricher.scala index 02f0fd0..1233c31 100644 --- a/nlpcraft/src/main/scala/org/apache/nlpcraft/probe/mgrs/nlp/enrichers/model/NCModelEnricher.scala +++ b/nlpcraft/src/main/scala/org/apache/nlpcraft/probe/mgrs/nlp/enrichers/model/NCModelEnricher.scala @@ -402,7 +402,7 @@ object NCModelEnricher extends NCProbeEnricher with DecorateAsScala { else t.wordIndexes.map(complexesWords) ) - // Drops without tokens (DSL part works with tokens). + // Drops without tokens (IDL part works with tokens). }).filter(_.exists(_.isToken)).map(ComplexSeq(_)).distinct ).seq @@ -434,7 +434,7 @@ object NCModelEnricher extends NCProbeEnricher with DecorateAsScala { flatMap(complexSeq ⇒ { val rec = complexSeq.tokensComplexes.filter(_.isSubsetOf(idxMin, idxMax, idxs)) - // Drops without tokens (DSL part works with tokens). + // Drops without tokens (IDL part works with tokens). if (rec.nonEmpty) Some( rec ++ diff --git a/nlpcraft/src/test/scala/org/apache/nlpcraft/model/NCIntentDslSpec.scala b/nlpcraft/src/test/scala/org/apache/nlpcraft/model/NCIntentDslSpec.scala index bb80ac2..5cd5c7b 100644 --- a/nlpcraft/src/test/scala/org/apache/nlpcraft/model/NCIntentDslSpec.scala +++ b/nlpcraft/src/test/scala/org/apache/nlpcraft/model/NCIntentDslSpec.scala @@ -25,10 +25,10 @@ import java.util import scala.language.implicitConversions /** - * Intents DSL test model. + * IDL test model. */ class NCIntentDslSpecModel extends NCModelAdapter( - "nlpcraft.intents.dsl.test", "Intents DSL Test Model", "1.0" + "nlpcraft.intents.dsl.test", "IDL Test Model", "1.0" ) { private implicit def convert(s: String): NCResult = NCResult.text(s) @@ -51,7 +51,7 @@ class NCIntentDslSpecModel extends NCModelAdapter( } /** - * Intents DSL test. + * IDL test. */ @NCTestEnvironment(model = classOf[NCIntentDslSpecModel], startClient = true) class NCIntentDslSpec extends NCTestContext { diff --git a/nlpcraft/src/test/scala/org/apache/nlpcraft/model/NCIntentDslSpec2.scala b/nlpcraft/src/test/scala/org/apache/nlpcraft/model/NCIntentDslSpec2.scala index 051f85b..4484060 100644 --- a/nlpcraft/src/test/scala/org/apache/nlpcraft/model/NCIntentDslSpec2.scala +++ b/nlpcraft/src/test/scala/org/apache/nlpcraft/model/NCIntentDslSpec2.scala @@ -24,10 +24,10 @@ import java.util import scala.language.implicitConversions /** - * Intents DSL test model. + * IDL test model. */ class NCIntentDslSpecModel2 extends NCModelAdapter( - "nlpcraft.intents.dsl.test", "Intents DSL Test Model", "1.0" + "nlpcraft.intents.dsl.test", "IDL Test Model", "1.0" ) { override def getElements: util.Set[NCElement] = Set(NCTestElement("a")) @@ -48,7 +48,7 @@ class NCIntentDslSpecModel2 extends NCModelAdapter( } /** - * Intents DSL test. + * IDL test. */ @NCTestEnvironment(model = classOf[NCIntentDslSpecModel2], startClient = true) class NCIntentDslSpec2 extends NCTestContext { diff --git a/nlpcraft/src/test/scala/org/apache/nlpcraft/model/intent/dsl/NCIntentDslTestModel.scala b/nlpcraft/src/test/scala/org/apache/nlpcraft/model/intent/dsl/NCIntentDslTestModel.scala index 56f6bc5..9fc4357 100644 --- a/nlpcraft/src/test/scala/org/apache/nlpcraft/model/intent/dsl/NCIntentDslTestModel.scala +++ b/nlpcraft/src/test/scala/org/apache/nlpcraft/model/intent/dsl/NCIntentDslTestModel.scala @@ -20,7 +20,7 @@ package org.apache.nlpcraft.model.intent.dsl import org.apache.nlpcraft.model._ /** - * Test model for intent DSL. + * Test model for IDL. */ class NCIntentDslTestModel extends NCModelFileAdapter("src/test/scala/org/apache/nlpcraft/model/intent/dsl/dsl_test_model.yaml") { @NCIntentRef("i1") diff --git a/nlpcraft/src/test/scala/org/apache/nlpcraft/model/intent/dsl/NCIntentDslTestSpec.scala b/nlpcraft/src/test/scala/org/apache/nlpcraft/model/intent/dsl/NCIntentDslTestSpec.scala index fd8d4b3..3e16e3c 100644 --- a/nlpcraft/src/test/scala/org/apache/nlpcraft/model/intent/dsl/NCIntentDslTestSpec.scala +++ b/nlpcraft/src/test/scala/org/apache/nlpcraft/model/intent/dsl/NCIntentDslTestSpec.scala @@ -27,7 +27,7 @@ import java.io.IOException import java.util.Collections /** - * DSL test model test. Make sure to start up the NLPCraft server before running this test. + * IDL test model test. Make sure to start up the NLPCraft server before running this test. */ class NCIntentDslTestSpec { private var cli: NCTestClient = _ diff --git a/nlpcraft/src/test/scala/org/apache/nlpcraft/model/intent/dsl/compiler/NCIdlCompilerSpec.scala b/nlpcraft/src/test/scala/org/apache/nlpcraft/model/intent/dsl/compiler/NCIdlCompilerSpec.scala index 30e7c53..e6f8fcc 100644 --- a/nlpcraft/src/test/scala/org/apache/nlpcraft/model/intent/dsl/compiler/NCIdlCompilerSpec.scala +++ b/nlpcraft/src/test/scala/org/apache/nlpcraft/model/intent/dsl/compiler/NCIdlCompilerSpec.scala @@ -23,7 +23,7 @@ import org.apache.nlpcraft.model.intent.compiler.{NCIdlCompiler, NCIdlCompilerGl import org.junit.jupiter.api.Test /** - * Tests for DSL compiler. + * Tests for IDL compiler. */ class NCIdlCompilerSpec { private final val MODEL_ID = "test.mdl.id" diff --git a/nlpcraft/src/test/scala/org/apache/nlpcraft/model/intent/dsl/dsl_test_model.yaml b/nlpcraft/src/test/scala/org/apache/nlpcraft/model/intent/dsl/dsl_test_model.yaml index fac0518..e1f027d 100644 --- a/nlpcraft/src/test/scala/org/apache/nlpcraft/model/intent/dsl/dsl_test_model.yaml +++ b/nlpcraft/src/test/scala/org/apache/nlpcraft/model/intent/dsl/dsl_test_model.yaml @@ -16,9 +16,9 @@ # id: "nlpcraft.dsl.test" -name: "Intent DSL Test Model" +name: "IDL Test Model" version: "1.0" -description: "Intent DSL test model." +description: "IDL test model." enabledBuiltInTokens: [ "nlpcraft:num", "nlpcraft:date" diff --git a/nlpcraft/src/test/scala/org/apache/nlpcraft/server/rest/NCRestAskSpec.scala b/nlpcraft/src/test/scala/org/apache/nlpcraft/server/rest/NCRestAskSpec.scala index b33cb1d..3a9e856 100644 --- a/nlpcraft/src/test/scala/org/apache/nlpcraft/server/rest/NCRestAskSpec.scala +++ b/nlpcraft/src/test/scala/org/apache/nlpcraft/server/rest/NCRestAskSpec.scala @@ -135,7 +135,7 @@ class NCRestAskSpec extends NCRestSpec { * @param usrId * @param data */ - private def testAsk( + def testAsk( sync: Boolean, enableLog: Option[java.lang.Boolean], usrId: Option[java.lang.Long], diff --git a/nlpcraft/src/test/scala/org/apache/nlpcraft/server/rest/NCRestCompanySpec.scala b/nlpcraft/src/test/scala/org/apache/nlpcraft/server/rest/NCRestCompanySpec.scala index fa31849..45480ab 100644 --- a/nlpcraft/src/test/scala/org/apache/nlpcraft/server/rest/NCRestCompanySpec.scala +++ b/nlpcraft/src/test/scala/org/apache/nlpcraft/server/rest/NCRestCompanySpec.scala @@ -183,7 +183,7 @@ class NCRestCompanySpec extends NCRestSpec { * @param postalCode * @param adminAvatarUrl */ - private def testCompany( + def testCompany( website: Option[String] = None, country: Option[String] = None, region: Option[String] = None, diff --git a/nlpcraft/src/test/scala/org/apache/nlpcraft/server/rest/NCRestModelSpec.scala b/nlpcraft/src/test/scala/org/apache/nlpcraft/server/rest/NCRestModelSpec.scala index 09d9a37..2327b0d 100644 --- a/nlpcraft/src/test/scala/org/apache/nlpcraft/server/rest/NCRestModelSpec.scala +++ b/nlpcraft/src/test/scala/org/apache/nlpcraft/server/rest/NCRestModelSpec.scala @@ -30,7 +30,7 @@ import scala.collection.JavaConverters._ @NCTestEnvironment(model = classOf[AlarmModel], startClient = false) class NCRestModelSpec extends NCRestSpec { @Test - private def test(): Unit = { + def test(): Unit = { def extract(data: java.util.List[java.util.Map[String, Object]]): Seq[Double] = data.asScala.map(_.get("score").asInstanceOf[Number].doubleValue())
