| <!DOCTYPE HTML> |
| <!-- NewPage --> |
| <html lang="en"> |
| <head> |
| <!-- Generated by javadoc (11.0.2) on Tue May 25 13:08:06 PDT 2021 --> |
| <title>NCModel (Apache NLPCraft 0.8.0)</title> |
| <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
| <meta name="dc.created" content="2021-05-25"> |
| <link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style"> |
| <link rel="stylesheet" type="text/css" href="../../../../jquery/jquery-ui.css" title="Style"> |
| <script type="text/javascript" src="../../../../script.js"></script> |
| <script type="text/javascript" src="../../../../jquery/jszip/dist/jszip.min.js"></script> |
| <script type="text/javascript" src="../../../../jquery/jszip-utils/dist/jszip-utils.min.js"></script> |
| <!--[if IE]> |
| <script type="text/javascript" src="../../../../jquery/jszip-utils/dist/jszip-utils-ie.min.js"></script> |
| <![endif]--> |
| <script type="text/javascript" src="../../../../jquery/jquery-3.3.1.js"></script> |
| <script type="text/javascript" src="../../../../jquery/jquery-migrate-3.0.1.js"></script> |
| <script type="text/javascript" src="../../../../jquery/jquery-ui.js"></script> |
| </head> |
| <body> |
| <script type="text/javascript"><!-- |
| try { |
| if (location.href.indexOf('is-external=true') == -1) { |
| parent.document.title="NCModel (Apache NLPCraft 0.8.0)"; |
| } |
| } |
| catch(err) { |
| } |
| //--> |
| var data = {"i0":18,"i1":18,"i2":18,"i3":18,"i4":18,"i5":18}; |
| var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],16:["t5","Default Methods"]}; |
| var altColor = "altColor"; |
| var rowColor = "rowColor"; |
| var tableTab = "tableTab"; |
| var activeTableTab = "activeTableTab"; |
| var pathtoroot = "../../../../"; |
| var useModuleDirectories = true; |
| loadScripts(document, 'script');</script> |
| <noscript> |
| <div>JavaScript is disabled on your browser.</div> |
| </noscript> |
| <header role="banner"> |
| <nav role="navigation"> |
| <div class="fixedNav"><link href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet"> <script src="https://nlpcraft.apache.org/javadoc/resources/sh/scripts/XRegExp.js" type="text/javascript"></script> <script src="https://nlpcraft.apache.org/javadoc/resources/sh/scripts/shCore.js" type="text/javascript"></script> <script src="https://nlpcraft.apache.org/javadoc/resources/sh/scripts/shAutoloader.js" type="text/javascript"></script> <link href="https://nlpcraft.apache.org/javadoc/resources/sh/styles/shCoreNLPCraft.css" rel="stylesheet" type="text/css" title="Style"> <link href="https://nlpcraft.apache.org/javadoc/resources/sh/styles/shThemeNLPCraft.css" rel="stylesheet" type="text/css" title="Style"> <link href="https://fonts.googleapis.com/css?family=Roboto+Mono" rel="stylesheet"> <link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet"> <script async defer src="https://buttons.github.io/buttons.js"></script> |
| <!-- ========= START OF TOP NAVBAR ======= --> |
| <div class="topNav"><a id="navbar.top"> |
| <!-- --> |
| </a> |
| <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> |
| <a id="navbar.top.firstrow"> |
| <!-- --> |
| </a> |
| <ul class="navList" title="Navigation"> |
| <li><a href="../../../../index.html">Overview</a></li> |
| <li><a href="package-summary.html">Package</a></li> |
| <li class="navBarCell1Rev">Class</li> |
| <li><a href="class-use/NCModel.html">Use</a></li> |
| <li><a href="package-tree.html">Tree</a></li> |
| <li><a href="../../../../deprecated-list.html">Deprecated</a></li> |
| <li><a href="../../../../index-all.html">Index</a></li> |
| <li><a href="../../../../help-doc.html">Help</a></li> |
| </ul> |
| <div class="aboutLanguage">Apache NLPCraft <span style="font-size: 80%">0.8.0</span></div> |
| </div> |
| <div class="subNav"> |
| <ul class="navList" id="allclasses_navbar_top"> |
| <li><a href="../../../../allclasses.html">All Classes</a></li> |
| </ul> |
| <ul class="navListSearch"> |
| <li><label for="search">SEARCH:</label> |
| <input type="text" id="search" value="search" disabled="disabled"> |
| <input type="reset" id="reset" value="reset" disabled="disabled"> |
| </li> |
| </ul> |
| <div> |
| <script type="text/javascript"><!-- |
| allClassesLink = document.getElementById("allclasses_navbar_top"); |
| if(window==top) { |
| allClassesLink.style.display = "block"; |
| } |
| else { |
| allClassesLink.style.display = "none"; |
| } |
| //--> |
| </script> |
| <noscript> |
| <div>JavaScript is disabled on your browser.</div> |
| </noscript> |
| </div> |
| <div> |
| <ul class="subNavList"> |
| <li>Summary: </li> |
| <li>Nested | </li> |
| <li><a href="#field.summary">Field</a> | </li> |
| <li>Constr | </li> |
| <li><a href="#method.summary">Method</a></li> |
| </ul> |
| <ul class="subNavList"> |
| <li>Detail: </li> |
| <li>Field | </li> |
| <li>Constr | </li> |
| <li><a href="#method.detail">Method</a></li> |
| </ul> |
| </div> |
| <a id="skip.navbar.top"> |
| <!-- --> |
| </a></div> |
| <!-- ========= END OF TOP NAVBAR ========= --> |
| </div> |
| <div class="navPadding"> </div> |
| <script type="text/javascript"><!-- |
| $('.navPadding').css('padding-top', $('.fixedNav').css("height")); |
| //--> |
| </script> |
| </nav> |
| </header> |
| <!-- ======== START OF CLASS DATA ======== --> |
| <main role="main"> |
| <div class="header"> |
| <div class="subTitle"><span class="packageLabelInType">Package</span> <a href="package-summary.html">org.apache.nlpcraft.model</a></div> |
| <h2 title="Interface NCModel" class="title">Interface NCModel</h2> |
| </div> |
| <div class="contentContainer"> |
| <div class="description"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <dl> |
| <dt>All Superinterfaces:</dt> |
| <dd><code><a href="NCLifecycle.html" title="interface in org.apache.nlpcraft.model">NCLifecycle</a></code>, <code><a href="NCMetadata.html" title="interface in org.apache.nlpcraft.model">NCMetadata</a></code>, <code><a href="NCModelView.html" title="interface in org.apache.nlpcraft.model">NCModelView</a></code></dd> |
| </dl> |
| <dl> |
| <dt>All Known Implementing Classes:</dt> |
| <dd><code><a href="NCModelAdapter.html" title="class in org.apache.nlpcraft.model">NCModelAdapter</a></code>, <code><a href="NCModelFileAdapter.html" title="class in org.apache.nlpcraft.model">NCModelFileAdapter</a></code></dd> |
| </dl> |
| <hr> |
| <pre>public interface <span class="typeNameLabel">NCModel</span> |
| extends <a href="NCModelView.html" title="interface in org.apache.nlpcraft.model">NCModelView</a>, <a href="NCLifecycle.html" title="interface in org.apache.nlpcraft.model">NCLifecycle</a></pre> |
| <div class="block">User-defined data model. |
| <p> |
| Data model is a central concept in NLPCraft defining an interface to your data sources |
| like a database or a SaaS application. NLPCraft employs model-as-a-code approach where entire data model |
| is an implementation of this interface which can be developed using any JVM programming language |
| like Java, Scala, Kotlin, or Groovy. Data model definition is split into two interfaces: <a href="NCModelView.html" title="interface in org.apache.nlpcraft.model"><code>NCModelView</code></a> |
| that defines the declarative, configuration, part of the model that is usually defined in an external |
| JSON or YAML file, and this interface that provides various life-cycle callbacks. |
| <p> |
| Generally, a data model defines: |
| <ul> |
| <li>Set of model <a href="NCElement.html" title="interface in org.apache.nlpcraft.model"><code>elements</code></a> (a.k.a. named entities) to be detected in the user input.</li> |
| <li>Zero or more <a target=_ href="https://nlpcraft.apache.org/intent-matching.html">intent</a> callbacks.</li> |
| <li>Common model configuration and life-cycle callbacks.</li> |
| </ul> |
| Note that model-as-a-code approach natively supports any software life cycle tools and frameworks like various |
| build tools, CI/SCM tools, IDEs, etc. You don't have to resort to additional web-based tools to manage some aspects of |
| your data models - your entire model and all of its components are part of your project's source code. |
| <p> |
| Read full documentation in <a target=_ href="https://nlpcraft.apache.org/data-model.html">Data Model</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>.</div> |
| <dl> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="NCModelAdapter.html" title="class in org.apache.nlpcraft.model"><code>NCModelAdapter</code></a>, |
| <a href="NCModelFileAdapter.html" title="class in org.apache.nlpcraft.model"><code>NCModelFileAdapter</code></a></dd> |
| </dl> |
| </li> |
| </ul> |
| </div> |
| <div class="summary"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <!-- =========== FIELD SUMMARY =========== --> |
| <section role="region"> |
| <ul class="blockList"> |
| <li class="blockList"><a id="field.summary"> |
| <!-- --> |
| </a> |
| <h3>Field Summary</h3> |
| <ul class="blockList"> |
| <li class="blockList"><a id="fields.inherited.from.class.org.apache.nlpcraft.model.NCModelView"> |
| <!-- --> |
| </a> |
| <h3>Fields inherited from interface org.apache.nlpcraft.model.<a href="NCModelView.html" title="interface in org.apache.nlpcraft.model">NCModelView</a></h3> |
| <code><a href="NCModelView.html#CONV_DEPTH_MAX">CONV_DEPTH_MAX</a>, <a href="NCModelView.html#CONV_DEPTH_MIN">CONV_DEPTH_MIN</a>, <a href="NCModelView.html#CONV_TIMEOUT_MAX">CONV_TIMEOUT_MAX</a>, <a href="NCModelView.html#CONV_TIMEOUT_MIN">CONV_TIMEOUT_MIN</a>, <a href="NCModelView.html#DFLT_CONV_DEPTH">DFLT_CONV_DEPTH</a>, <a href="NCModelView.html#DFLT_CONV_TIMEOUT_MS">DFLT_CONV_TIMEOUT_MS</a>, <a href="NCModelView.html#DFLT_ENABLED_BUILTIN_TOKENS">DFLT_ENABLED_BUILTIN_TOKENS</a>, <a href="NCModelView.html#DFLT_IS_DUP_SYNONYMS_ALLOWED">DFLT_IS_DUP_SYNONYMS_ALLOWED</a>, <a href="NCModelView.html#DFLT_IS_NO_NOUNS_ALLOWED">DFLT_IS_NO_NOUNS_ALLOWED</a>, <a href="NCModelView.html#DFLT_IS_NO_USER_TOKENS_ALLOWED">DFLT_IS_NO_USER_TOKENS_ALLOWED</a>, <a href="NCModelView.html#DFLT_IS_NON_ENGLISH_ALLOWED">DFLT_IS_NON_ENGLISH_ALLOWED</a>, <a href="NCModelView.html#DFLT_IS_NOT_LATIN_CHARSET_ALLOWED">DFLT_IS_NOT_LATIN_CHARSET_ALLOWED</a>, <a href="NCModelView.html#DFLT_IS_PERMUTATE_SYNONYMS">DFLT_IS_PERMUTATE_SYNONYMS</a>, <a href="NCModelView.html#DFLT_IS_SPARSE">DFLT_IS_SPARSE</a>, <a href="NCModelView.html#DFLT_IS_SWEAR_WORDS_ALLOWED">DFLT_IS_SWEAR_WORDS_ALLOWED</a>, <a href="NCModelView.html#DFLT_MAX_ELEMENT_SYNONYMS">DFLT_MAX_ELEMENT_SYNONYMS</a>, <a href="NCModelView.html#DFLT_MAX_FREE_WORDS">DFLT_MAX_FREE_WORDS</a>, <a href="NCModelView.html#DFLT_MAX_SUSPICIOUS_WORDS">DFLT_MAX_SUSPICIOUS_WORDS</a>, <a href="NCModelView.html#DFLT_MAX_SYNONYMS_THRESHOLD_ERROR">DFLT_MAX_SYNONYMS_THRESHOLD_ERROR</a>, <a href="NCModelView.html#DFLT_MAX_TOKENS">DFLT_MAX_TOKENS</a>, <a href="NCModelView.html#DFLT_MAX_TOTAL_SYNONYMS">DFLT_MAX_TOTAL_SYNONYMS</a>, <a href="NCModelView.html#DFLT_MAX_UNKNOWN_WORDS">DFLT_MAX_UNKNOWN_WORDS</a>, <a href="NCModelView.html#DFLT_MAX_WORDS">DFLT_MAX_WORDS</a>, <a href="NCModelView.html#DFLT_METADATA">DFLT_METADATA</a>, <a href="NCModelView.html#DFLT_MIN_NON_STOPWORDS">DFLT_MIN_NON_STOPWORDS</a>, <a href="NCModelView.html#DFLT_MIN_TOKENS">DFLT_MIN_TOKENS</a>, <a href="NCModelView.html#DFLT_MIN_WORDS">DFLT_MIN_WORDS</a>, <a href="NCModelView.html#MAX_FREE_WORDS_MAX">MAX_FREE_WORDS_MAX</a>, <a href="NCModelView.html#MAX_FREE_WORDS_MIN">MAX_FREE_WORDS_MIN</a>, <a href="NCModelView.html#MAX_SUSPICIOUS_WORDS_MAX">MAX_SUSPICIOUS_WORDS_MAX</a>, <a href="NCModelView.html#MAX_SUSPICIOUS_WORDS_MIN">MAX_SUSPICIOUS_WORDS_MIN</a>, <a href="NCModelView.html#MAX_SYN_MAX">MAX_SYN_MAX</a>, <a href="NCModelView.html#MAX_SYN_MIN">MAX_SYN_MIN</a>, <a href="NCModelView.html#MAX_TOKENS_MAX">MAX_TOKENS_MAX</a>, <a href="NCModelView.html#MAX_TOKENS_MIN">MAX_TOKENS_MIN</a>, <a href="NCModelView.html#MAX_UNKNOWN_WORDS_MAX">MAX_UNKNOWN_WORDS_MAX</a>, <a href="NCModelView.html#MAX_UNKNOWN_WORDS_MIN">MAX_UNKNOWN_WORDS_MIN</a>, <a href="NCModelView.html#MAX_WORDS_MAX">MAX_WORDS_MAX</a>, <a href="NCModelView.html#MAX_WORDS_MIN">MAX_WORDS_MIN</a>, <a href="NCModelView.html#MIN_NON_STOPWORDS_MAX">MIN_NON_STOPWORDS_MAX</a>, <a href="NCModelView.html#MIN_NON_STOPWORDS_MIN">MIN_NON_STOPWORDS_MIN</a>, <a href="NCModelView.html#MIN_TOKENS_MAX">MIN_TOKENS_MAX</a>, <a href="NCModelView.html#MIN_TOKENS_MIN">MIN_TOKENS_MIN</a>, <a href="NCModelView.html#MIN_WORDS_MAX">MIN_WORDS_MAX</a>, <a href="NCModelView.html#MIN_WORDS_MIN">MIN_WORDS_MIN</a>, <a href="NCModelView.html#MODEL_ID_MAXLEN">MODEL_ID_MAXLEN</a>, <a href="NCModelView.html#MODEL_NAME_MAXLEN">MODEL_NAME_MAXLEN</a>, <a href="NCModelView.html#MODEL_VERSION_MAXLEN">MODEL_VERSION_MAXLEN</a></code></li> |
| </ul> |
| </li> |
| </ul> |
| </section> |
| <!-- ========== METHOD SUMMARY =========== --> |
| <section role="region"> |
| <ul class="blockList"> |
| <li class="blockList"><a id="method.summary"> |
| <!-- --> |
| </a> |
| <h3>Method Summary</h3> |
| <table class="memberSummary"> |
| <caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd"> </span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd"> </span></span><span id="t5" class="tableTab"><span><a href="javascript:show(16);">Default Methods</a></span><span class="tabEnd"> </span></span></caption> |
| <tr> |
| <th class="colFirst" scope="col">Modifier and Type</th> |
| <th class="colSecond" scope="col">Method</th> |
| <th class="colLast" scope="col">Description</th> |
| </tr> |
| <tr id="i0" class="altColor"> |
| <td class="colFirst"><code>default <a href="NCResult.html" title="class in org.apache.nlpcraft.model">NCResult</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#onContext(org.apache.nlpcraft.model.NCContext)">onContext</a></span>​(<a href="NCContext.html" title="interface in org.apache.nlpcraft.model">NCContext</a> ctx)</code></th> |
| <td class="colLast"> |
| <div class="block">A callback that is called when a fully assembled query context is ready.</div> |
| </td> |
| </tr> |
| <tr id="i1" class="rowColor"> |
| <td class="colFirst"><code>default <a href="NCResult.html" title="class in org.apache.nlpcraft.model">NCResult</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#onError(org.apache.nlpcraft.model.NCContext,java.lang.Throwable)">onError</a></span>​(<a href="NCContext.html" title="interface in org.apache.nlpcraft.model">NCContext</a> ctx, |
| <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Throwable.html?is-external=true" title="class or interface in java.lang" class="externalLink">Throwable</a> e)</code></th> |
| <td class="colLast"> |
| <div class="block">A callback that is called when intent callback failed with unexpected exception.</div> |
| </td> |
| </tr> |
| <tr id="i2" class="altColor"> |
| <td class="colFirst"><code>default boolean</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#onMatchedIntent(org.apache.nlpcraft.model.NCIntentMatch)">onMatchedIntent</a></span>​(<a href="NCIntentMatch.html" title="interface in org.apache.nlpcraft.model">NCIntentMatch</a> ctx)</code></th> |
| <td class="colLast"> |
| <div class="block">A callback that is called when intent was successfully matched but right before its callback is called.</div> |
| </td> |
| </tr> |
| <tr id="i3" class="rowColor"> |
| <td class="colFirst"><code>default boolean</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#onParsedVariant(org.apache.nlpcraft.model.NCVariant)">onParsedVariant</a></span>​(<a href="NCVariant.html" title="interface in org.apache.nlpcraft.model">NCVariant</a> var)</code></th> |
| <td class="colLast"> |
| <div class="block">A callback to accept or reject a parsed variant.</div> |
| </td> |
| </tr> |
| <tr id="i4" class="altColor"> |
| <td class="colFirst"><code>default <a href="NCResult.html" title="class in org.apache.nlpcraft.model">NCResult</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#onRejection(org.apache.nlpcraft.model.NCIntentMatch,org.apache.nlpcraft.model.NCRejection)">onRejection</a></span>​(<a href="NCIntentMatch.html" title="interface in org.apache.nlpcraft.model">NCIntentMatch</a> ctx, |
| <a href="NCRejection.html" title="class in org.apache.nlpcraft.model">NCRejection</a> e)</code></th> |
| <td class="colLast"> |
| <div class="block">A callback that is called when intent callback threw <a href="NCRejection.html" title="class in org.apache.nlpcraft.model"><code>NCRejection</code></a> exception.</div> |
| </td> |
| </tr> |
| <tr id="i5" class="rowColor"> |
| <td class="colFirst"><code>default <a href="NCResult.html" title="class in org.apache.nlpcraft.model">NCResult</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#onResult(org.apache.nlpcraft.model.NCIntentMatch,org.apache.nlpcraft.model.NCResult)">onResult</a></span>​(<a href="NCIntentMatch.html" title="interface in org.apache.nlpcraft.model">NCIntentMatch</a> ctx, |
| <a href="NCResult.html" title="class in org.apache.nlpcraft.model">NCResult</a> res)</code></th> |
| <td class="colLast"> |
| <div class="block">A callback that is called when successful result is obtained from the intent callback and right before sending it |
| back to the caller.</div> |
| </td> |
| </tr> |
| </table> |
| <ul class="blockList"> |
| <li class="blockList"><a id="methods.inherited.from.class.org.apache.nlpcraft.model.NCLifecycle"> |
| <!-- --> |
| </a> |
| <h3>Methods inherited from interface org.apache.nlpcraft.model.<a href="NCLifecycle.html" title="interface in org.apache.nlpcraft.model">NCLifecycle</a></h3> |
| <code><a href="NCLifecycle.html#onDiscard()">onDiscard</a>, <a href="NCLifecycle.html#onInit()">onInit</a></code></li> |
| </ul> |
| <ul class="blockList"> |
| <li class="blockList"><a id="methods.inherited.from.class.org.apache.nlpcraft.model.NCMetadata"> |
| <!-- --> |
| </a> |
| <h3>Methods inherited from interface org.apache.nlpcraft.model.<a href="NCMetadata.html" title="interface in org.apache.nlpcraft.model">NCMetadata</a></h3> |
| <code><a href="NCMetadata.html#meta(java.lang.String)">meta</a>, <a href="NCMetadata.html#meta(java.lang.String,T)">meta</a>, <a href="NCMetadata.html#metaOpt(java.lang.String)">metaOpt</a>, <a href="NCMetadata.html#metax(java.lang.String)">metax</a></code></li> |
| </ul> |
| <ul class="blockList"> |
| <li class="blockList"><a id="methods.inherited.from.class.org.apache.nlpcraft.model.NCModelView"> |
| <!-- --> |
| </a> |
| <h3>Methods inherited from interface org.apache.nlpcraft.model.<a href="NCModelView.html" title="interface in org.apache.nlpcraft.model">NCModelView</a></h3> |
| <code><a href="NCModelView.html#getAbstractTokens()">getAbstractTokens</a>, <a href="NCModelView.html#getAdditionalStopWords()">getAdditionalStopWords</a>, <a href="NCModelView.html#getConversationDepth()">getConversationDepth</a>, <a href="NCModelView.html#getConversationTimeout()">getConversationTimeout</a>, <a href="NCModelView.html#getDescription()">getDescription</a>, <a href="NCModelView.html#getElements()">getElements</a>, <a href="NCModelView.html#getEnabledBuiltInTokens()">getEnabledBuiltInTokens</a>, <a href="NCModelView.html#getExcludedStopWords()">getExcludedStopWords</a>, <a href="NCModelView.html#getId()">getId</a>, <a href="NCModelView.html#getMacros()">getMacros</a>, <a href="NCModelView.html#getMaxElementSynonyms()">getMaxElementSynonyms</a>, <a href="NCModelView.html#getMaxFreeWords()">getMaxFreeWords</a>, <a href="NCModelView.html#getMaxSuspiciousWords()">getMaxSuspiciousWords</a>, <a href="NCModelView.html#getMaxTokens()">getMaxTokens</a>, <a href="NCModelView.html#getMaxTotalSynonyms()">getMaxTotalSynonyms</a>, <a href="NCModelView.html#getMaxUnknownWords()">getMaxUnknownWords</a>, <a href="NCModelView.html#getMaxWords()">getMaxWords</a>, <a href="NCModelView.html#getMetadata()">getMetadata</a>, <a href="NCModelView.html#getMinNonStopwords()">getMinNonStopwords</a>, <a href="NCModelView.html#getMinTokens()">getMinTokens</a>, <a href="NCModelView.html#getMinWords()">getMinWords</a>, <a href="NCModelView.html#getName()">getName</a>, <a href="NCModelView.html#getOrigin()">getOrigin</a>, <a href="NCModelView.html#getParsers()">getParsers</a>, <a href="NCModelView.html#getRestrictedCombinations()">getRestrictedCombinations</a>, <a href="NCModelView.html#getSuspiciousWords()">getSuspiciousWords</a>, <a href="NCModelView.html#getVersion()">getVersion</a>, <a href="NCModelView.html#isDupSynonymsAllowed()">isDupSynonymsAllowed</a>, <a href="NCModelView.html#isMaxSynonymsThresholdError()">isMaxSynonymsThresholdError</a>, <a href="NCModelView.html#isNonEnglishAllowed()">isNonEnglishAllowed</a>, <a href="NCModelView.html#isNoNounsAllowed()">isNoNounsAllowed</a>, <a href="NCModelView.html#isNotLatinCharsetAllowed()">isNotLatinCharsetAllowed</a>, <a href="NCModelView.html#isNoUserTokensAllowed()">isNoUserTokensAllowed</a>, <a href="NCModelView.html#isPermutateSynonyms()">isPermutateSynonyms</a>, <a href="NCModelView.html#isSparse()">isSparse</a>, <a href="NCModelView.html#isSwearWordsAllowed()">isSwearWordsAllowed</a></code></li> |
| </ul> |
| </li> |
| </ul> |
| </section> |
| </li> |
| </ul> |
| </div> |
| <div class="details"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <!-- ============ METHOD DETAIL ========== --> |
| <section role="region"> |
| <ul class="blockList"> |
| <li class="blockList"><a id="method.detail"> |
| <!-- --> |
| </a> |
| <h3>Method Detail</h3> |
| <a id="onParsedVariant(org.apache.nlpcraft.model.NCVariant)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>onParsedVariant</h4> |
| <pre class="methodSignature">default boolean onParsedVariant​(<a href="NCVariant.html" title="interface in org.apache.nlpcraft.model">NCVariant</a> var)</pre> |
| <div class="block">A callback to accept or reject a parsed variant. This callback is called before any other |
| callbacks at the beginning of the processing pipeline and it is called for each parsed variant. |
| <p> |
| Note that a given user input can have one or more possible different parsing variants. Depending on model |
| configuration a user input can produce hundreds or even thousands of parsing variants that can significantly slow |
| down the overall processing. This method allows to filter out unnecessary parsing variants based on variety of |
| user-defined factors like number of tokens, presence of a particular token in the variant, etc. |
| <p> |
| By default, this method accepts all variants (returns <code>true</code>).</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>var</code> - A variant (list of tokens) to accept or reject.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd><code>True</code> to accept variant for further processing, <code>false</code> otherwise.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="onContext(org.apache.nlpcraft.model.NCContext)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>onContext</h4> |
| <pre class="methodSignature">default <a href="NCResult.html" title="class in org.apache.nlpcraft.model">NCResult</a> onContext​(<a href="NCContext.html" title="interface in org.apache.nlpcraft.model">NCContext</a> ctx) |
| throws <a href="NCRejection.html" title="class in org.apache.nlpcraft.model">NCRejection</a></pre> |
| <div class="block">A callback that is called when a fully assembled query context is ready. This callback is called after |
| all <a href="#onParsedVariant(org.apache.nlpcraft.model.NCVariant)"><code>onParsedVariant(NCVariant)</code></a> callbacks are called but before any <a href="#onMatchedIntent(org.apache.nlpcraft.model.NCIntentMatch)"><code>onMatchedIntent(NCIntentMatch)</code></a> |
| are called, i.e. right before the intent matching is performed. It's called always once per user request processing. |
| Typical use case for this callback is to perform logging, debugging, statistic or usage collection, |
| explicit update or initialization of conversation context, security audit or validation, etc. |
| <p> |
| Default implementation returns <code>null</code>.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>ctx</code> - Query context.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>Optional query result to return interrupting the default workflow. Specifically, if this method returns |
| a non-<code>null</code> result, it will be returned to the caller immediately overriding default behavior. If |
| the method returns <code>null</code> - the default processing flow will continue.</dd> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code><a href="NCRejection.html" title="class in org.apache.nlpcraft.model">NCRejection</a></code> - This callback can throw this rejection exception to abort user request processing.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="onMatchedIntent(org.apache.nlpcraft.model.NCIntentMatch)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>onMatchedIntent</h4> |
| <pre class="methodSignature">default boolean onMatchedIntent​(<a href="NCIntentMatch.html" title="interface in org.apache.nlpcraft.model">NCIntentMatch</a> ctx) |
| throws <a href="NCRejection.html" title="class in org.apache.nlpcraft.model">NCRejection</a></pre> |
| <div class="block">A callback that is called when intent was successfully matched but right before its callback is called. |
| This callback is called after <a href="#onContext(org.apache.nlpcraft.model.NCContext)"><code>onContext(NCContext)</code></a> is called and may be called multiple times |
| depending on its return value. If <code>true</code> is returned than the default workflow will continue and |
| the matched intent's callback will be called. However, if <code>false</code> is returned than the entire |
| existing set of parsing variants will be matched against all declared intents again. Returning <code>false</code> |
| allows this method to alter the state of the model (like soft-reset conversation or change metadata) and |
| force the full re-evaluation of the parsing variants against all declared intents. Note that user logic should |
| be careful not to induce infinite loop in this behavior. |
| <p> |
| Note that this callback may not be called at all based on the return value |
| of <a href="#onContext(org.apache.nlpcraft.model.NCContext)"><code>onContext(NCContext)</code></a> callback. Typical use case for this callback is to perform logging, debugging, |
| statistic or usage collection, explicit update or initialization of conversation context, security audit |
| or validation, etc. |
| <p> |
| By default, this method returns <code>true</code>.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>ctx</code> - Intent match context - the same instance that's passed to the matched intent callback.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>If <code>true</code> is returned than the default workflow will continue and the matched intent's callback |
| will be called. However, if <code>false</code> is returned than the entire existing set of parsing variants will |
| be matched against all declared intents again. Returning <code>false</code> allows this method to alter the state of |
| the model (like soft-reset conversation or change metadata) and force the re-evaluation of the parsing |
| variants against all declared intents. Note that user logic should be careful not to induce infinite loop in |
| this behavior.</dd> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code><a href="NCRejection.html" title="class in org.apache.nlpcraft.model">NCRejection</a></code> - This callback can throw the rejection exception to abort user request processing. In this |
| case the <a href="#onRejection(org.apache.nlpcraft.model.NCIntentMatch,org.apache.nlpcraft.model.NCRejection)"><code>onRejection(NCIntentMatch, NCRejection)</code></a> callback will be called next.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="onResult(org.apache.nlpcraft.model.NCIntentMatch,org.apache.nlpcraft.model.NCResult)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>onResult</h4> |
| <pre class="methodSignature">default <a href="NCResult.html" title="class in org.apache.nlpcraft.model">NCResult</a> onResult​(<a href="NCIntentMatch.html" title="interface in org.apache.nlpcraft.model">NCIntentMatch</a> ctx, |
| <a href="NCResult.html" title="class in org.apache.nlpcraft.model">NCResult</a> res)</pre> |
| <div class="block">A callback that is called when successful result is obtained from the intent callback and right before sending it |
| back to the caller. This callback is called after <a href="#onMatchedIntent(org.apache.nlpcraft.model.NCIntentMatch)"><code>onMatchedIntent(NCIntentMatch)</code></a> is called. |
| Note that this callback may not be called at all, and if called - it's called only once. |
| Typical use case for this callback is to perform logging, debugging, statistic or usage collection, |
| explicit update or initialization of conversation context, security audit or validation, etc. |
| <p> |
| Default implementation is a no-op returning <code>null</code>.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>ctx</code> - Intent match context - the same instance that's passed to the matched intent callback that |
| produced this result.</dd> |
| <dd><code>res</code> - Existing result.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>Optional query result to return interrupting the default workflow. Specifically, if this method returns |
| a non-<code>null</code> result, it will be returned to the caller immediately overriding default behavior and |
| existing query result or error processing, if any. If the method returns <code>null</code> - the default |
| processing flow will continue.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="onRejection(org.apache.nlpcraft.model.NCIntentMatch,org.apache.nlpcraft.model.NCRejection)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>onRejection</h4> |
| <pre class="methodSignature">default <a href="NCResult.html" title="class in org.apache.nlpcraft.model">NCResult</a> onRejection​(<a href="NCIntentMatch.html" title="interface in org.apache.nlpcraft.model">NCIntentMatch</a> ctx, |
| <a href="NCRejection.html" title="class in org.apache.nlpcraft.model">NCRejection</a> e)</pre> |
| <div class="block">A callback that is called when intent callback threw <a href="NCRejection.html" title="class in org.apache.nlpcraft.model"><code>NCRejection</code></a> exception. |
| This callback is called after <a href="#onMatchedIntent(org.apache.nlpcraft.model.NCIntentMatch)"><code>onMatchedIntent(NCIntentMatch)</code></a> is called. |
| Note that this callback may not be called at all, and if called - it's called only once. |
| Typical use case for this callback is to perform logging, debugging, statistic or usage collection, |
| explicit update or initialization of conversation context, security audit or validation, etc. |
| <p> |
| Default implementation is a no-op returning <code>null</code>.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>ctx</code> - Optional intent match context - the same instance that's passed to the matched intent callback that |
| produced this rejection. It is <code>null</code> if rejection was triggered outside of the intent callback.</dd> |
| <dd><code>e</code> - Rejection exception.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>Optional query result to return interrupting the default workflow. Specifically, if this method returns |
| a non-<code>null</code> result, it will be returned to the caller immediately overriding default behavior and |
| existing query result or error processing, if any. If the method returns <code>null</code> - the default |
| processing flow will continue.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="onError(org.apache.nlpcraft.model.NCContext,java.lang.Throwable)"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>onError</h4> |
| <pre class="methodSignature">default <a href="NCResult.html" title="class in org.apache.nlpcraft.model">NCResult</a> onError​(<a href="NCContext.html" title="interface in org.apache.nlpcraft.model">NCContext</a> ctx, |
| <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Throwable.html?is-external=true" title="class or interface in java.lang" class="externalLink">Throwable</a> e)</pre> |
| <div class="block">A callback that is called when intent callback failed with unexpected exception. |
| Note that this callback may not be called at all, and if called - it's called only once. |
| Typical use case for this callback is to perform logging, debugging, statistic or usage collection, |
| explicit update or initialization of conversation context, security audit or validation, etc. |
| <p> |
| Default implementation is a no-op returning <code>null</code>.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>ctx</code> - Intent match context - the same instance that's passed to the matched intent that |
| produced this error.</dd> |
| <dd><code>e</code> - Failure exception.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>Optional query result to return interrupting the default workflow. Specifically, if this method returns |
| a non-<code>null</code> result, it will be returned to the caller immediately overriding default behavior and |
| existing query result or error processing, if any. If the method returns <code>null</code> - the default |
| processing flow will continue.</dd> |
| </dl> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </section> |
| </li> |
| </ul> |
| </div> |
| </div> |
| </main> |
| <!-- ========= END OF CLASS DATA ========= --> |
| <footer role="contentinfo"> |
| <nav role="navigation"> |
| <!-- ======= START OF BOTTOM NAVBAR ====== --> |
| <div class="bottomNav"><a id="navbar.bottom"> |
| <!-- --> |
| </a> |
| <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> |
| <a id="navbar.bottom.firstrow"> |
| <!-- --> |
| </a> |
| <ul class="navList" title="Navigation"> |
| <li><a href="../../../../index.html">Overview</a></li> |
| <li><a href="package-summary.html">Package</a></li> |
| <li class="navBarCell1Rev">Class</li> |
| <li><a href="class-use/NCModel.html">Use</a></li> |
| <li><a href="package-tree.html">Tree</a></li> |
| <li><a href="../../../../deprecated-list.html">Deprecated</a></li> |
| <li><a href="../../../../index-all.html">Index</a></li> |
| <li><a href="../../../../help-doc.html">Help</a></li> |
| </ul> |
| <div class="aboutLanguage"><span style="vertical-align: super">Apache NLPCraft <span style="font-size: 80%">0.8.0</span></span> <a style="vertical-align: super; margin-right: 10px" href="https://github.com/apache/incubator-nlpcraft" target="github"><i class="fa fa-github github-logo"></i></a> <a class="github-button" href="https://github.com/apache/incubator-nlpcraft/tree/master/nlpcraft-examples" data-icon="octicon-eye" aria-label="NLPCraft Examples">Examples</a> <a class="github-button" href="https://github.com/apache/incubator-nlpcraft" data-icon="octicon-star" aria-label="Star on GitHub">Star</a> <a class="github-button" href="https://github.com/apache/incubator-nlpcraft/fork" data-icon="octicon-repo-forked" aria-label="Fork on GitHub">Fork</a> <script type="text/javascript"> SyntaxHighlighter.defaults["auto-links"] = false; SyntaxHighlighter.defaults["tab-size"] = 2; SyntaxHighlighter.autoloader( 'java https://nlpcraft.apache.org/javadoc/resources/sh/scripts/shBrushJava.js', 'js jscript javascript https://nlpcraft.apache.org/javadoc/resources/sh/scripts/shBrushJScript.js', 'text plain https://nlpcraft.apache.org/javadoc/resources/sh/scripts/shBrushPlain.js', 'py python https://nlpcraft.apache.org/javadoc/resources/sh/scripts/shBrushPython.js', 'ruby rails ror rb https://nlpcraft.apache.org/javadoc/resources/sh/scripts/shBrushRuby.js', 'scala https://nlpcraft.apache.org/javadoc/resources/sh/scripts/shBrushScala.js', 'sql https://nlpcraft.apache.org/javadoc/resources/sh/scripts/shBrushSql.js', 'xml xhtml xslt html https://nlpcraft.apache.org/javadoc/resources/sh/scripts/shBrushXml.js' ); SyntaxHighlighter.all(); </script></div> |
| </div> |
| <div class="subNav"> |
| <ul class="navList" id="allclasses_navbar_bottom"> |
| <li><a href="../../../../allclasses.html">All Classes</a></li> |
| </ul> |
| <div> |
| <script type="text/javascript"><!-- |
| allClassesLink = document.getElementById("allclasses_navbar_bottom"); |
| if(window==top) { |
| allClassesLink.style.display = "block"; |
| } |
| else { |
| allClassesLink.style.display = "none"; |
| } |
| //--> |
| </script> |
| <noscript> |
| <div>JavaScript is disabled on your browser.</div> |
| </noscript> |
| </div> |
| <div> |
| <ul class="subNavList"> |
| <li>Summary: </li> |
| <li>Nested | </li> |
| <li><a href="#field.summary">Field</a> | </li> |
| <li>Constr | </li> |
| <li><a href="#method.summary">Method</a></li> |
| </ul> |
| <ul class="subNavList"> |
| <li>Detail: </li> |
| <li>Field | </li> |
| <li>Constr | </li> |
| <li><a href="#method.detail">Method</a></li> |
| </ul> |
| </div> |
| <a id="skip.navbar.bottom"> |
| <!-- --> |
| </a></div> |
| <!-- ======== END OF BOTTOM NAVBAR ======= --> |
| </nav> |
| <p class="legalCopy"><small><center> <br/> <span style="font-size: larger">Copyright © 2021 Apache Software Foundation</span> <br/> <br/> <img src="https://www.apache.org/img/ASF20thAnniversary.jpg" height="64px" alt="ASF Logo"> </center></small></p> |
| </footer> |
| </body> |
| </html> |