UNPKG

bravey

Version:

A simple JavaScript NLP-like library to help you creating your own bot.

1,729 lines (511 loc) 24.4 kB
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>JSDoc: Global</title> <script src="scripts/prettify/prettify.js"> </script> <script src="scripts/prettify/lang-css.js"> </script> <!--[if lt IE 9]> <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css"> <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css"> </head> <body> <div id="main"> <h1 class="page-title">Global</h1> <section> <header> <h2></h2> </header> <article> <div class="container-overview"> <dl class="details"> </dl> </div> <h3 class="subsection-title">Type Definitions</h3> <h4 class="name" id="ContextManagerResultByContext">ContextManagerResultByContext</h4> <div class="description"> Describes a match from a specific context. See Bravey.ContextManager.testByContext </div> <h5>Type:</h5> <ul> <li> <span class="param-type">Object</span> </li> </ul> <h5 class="subsection-title">Properties:</h5> <table class="props"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>result</code></td> <td class="type"> <span class="param-type"><a href="global.html#NlpResult">NlpResult</a></span> </td> <td class="description last">The result of a query.</td> </tr> <tr> <td class="name"><code>context</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="description last">The matched context tag. <tt>undefined</tt> if no domain matched.</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="contextmanagers_ContextManager.js.html">contextmanagers/ContextManager.js</a>, <a href="contextmanagers_ContextManager.js.html#line161">line 161</a> </li></ul></dd> </dl> <h4 class="name" id="ContextManagerResultBySessionId">ContextManagerResultBySessionId</h4> <div class="description"> Describes a match from a specific session ID. See Bravey.ContextManager.testBySessionId </div> <h5>Type:</h5> <ul> <li> <span class="param-type">Object</span> </li> </ul> <h5 class="subsection-title">Properties:</h5> <table class="props"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>result</code></td> <td class="type"> <span class="param-type"><a href="global.html#NlpResult">NlpResult</a></span> </td> <td class="description last">The result of a query.</td> </tr> <tr> <td class="name"><code>context</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="description last">The matched context tag. <tt>undefined</tt> if no domain matched.</td> </tr> <tr> <td class="name"><code>sessionId</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="description last">The session ID used for matching.</td> </tr> <tr> <td class="name"><code>sessionContext</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="description last">The session context tags used for matching. <tt>undefined</tt> if no domain matched.</td> </tr> <tr> <td class="name"><code>sessionData</code></td> <td class="type"> <span class="param-type">Object</span> </td> <td class="description last">The session data for the requested sessionId. <tt>undefined</tt> if no domain matched.</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="contextmanagers_ContextManager.js.html">contextmanagers/ContextManager.js</a>, <a href="contextmanagers_ContextManager.js.html#line169">line 169</a> </li></ul></dd> </dl> <h4 class="name" id="DocumentClassification">DocumentClassification</h4> <div class="description"> Describes a document classification. </div> <h5>Type:</h5> <ul> <li> <span class="param-type">Object</span> </li> </ul> <h5 class="subsection-title">Properties:</h5> <table class="props"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>scores</code></td> <td class="type"> <span class="param-type">Array.&lt;number></span> </td> <td class="description last">The related scores for each known document label.</td> </tr> <tr> <td class="name"><code>winner.score</code></td> <td class="type"> <span class="param-type">number</span> </td> <td class="description last">The score of the winning label.</td> </tr> <tr> <td class="name"><code>winner.label</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="description last">The name of the winning label.</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="classifiers_DocumentClassifier.js.html">classifiers/DocumentClassifier.js</a>, <a href="classifiers_DocumentClassifier.js.html#line195">line 195</a> </li></ul></dd> </dl> <h4 class="name" id="Entity">Entity</h4> <div class="description"> Defines an entity. </div> <h5>Type:</h5> <ul> <li> <span class="param-type">Object</span> </li> </ul> <h5 class="subsection-title">Properties:</h5> <table class="props"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>entity</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="description last">The entity type.</td> </tr> <tr> <td class="name"><code>string</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="description last">The raw text representing the entity.</td> </tr> <tr> <td class="name"><code>position</code></td> <td class="type"> <span class="param-type">number</span> </td> <td class="description last">The entity position in a sentence.</td> </tr> <tr> <td class="name"><code>value</code></td> <td class="type"> <span class="param-type">any</span> </td> <td class="description last">The entity logic value.</td> </tr> <tr> <td class="name"><code>priority</code></td> <td class="type"> <span class="param-type">number</span> </td> <td class="description last">The entity relative priority.</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="bravey.js.html">bravey.js</a>, <a href="bravey.js.html#line50">line 50</a> </li></ul></dd> </dl> <h4 class="name" id="IntentEntity">IntentEntity</h4> <div class="description"> Describes an entity to be matched in an intent. </div> <h5>Type:</h5> <ul> <li> <span class="param-type">Object</span> </li> </ul> <h5 class="subsection-title">Properties:</h5> <table class="props"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>entity</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="description last">The entity type to be found.</td> </tr> <tr> <td class="name"><code>id</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="description last">The entity ID to be assigned when found.</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="nlp_Sequential.js.html">nlp/Sequential.js</a>, <a href="nlp_Sequential.js.html#line380">line 380</a> </li></ul></dd> </dl> <h4 class="name" id="IntentEntity">IntentEntity</h4> <div class="description"> Describes an entity to be matched in an intent. </div> <h5>Type:</h5> <ul> <li> <span class="param-type">Object</span> </li> </ul> <h5 class="subsection-title">Properties:</h5> <table class="props"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>entity</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="description last">The entity type to be found.</td> </tr> <tr> <td class="name"><code>id</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="description last">The entity ID to be assigned when found.</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="nlp_Fuzzy.js.html">nlp/Fuzzy.js</a>, <a href="nlp_Fuzzy.js.html#line389">line 389</a> </li></ul></dd> </dl> <h4 class="name" id="NlpResult">NlpResult</h4> <div class="description"> Describes a sentence classification and entities. </div> <h5>Type:</h5> <ul> <li> <span class="param-type">Object</span> </li> </ul> <h5 class="subsection-title">Properties:</h5> <table class="props"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>entities</code></td> <td class="type"> <span class="param-type">Array.&lt;<a href="global.html#Entity">Entity</a>></span> </td> <td class="description last">The ordered list of found entities.</td> </tr> <tr> <td class="name"><code>entitiesIndex</code></td> <td class="type"> <span class="param-type">Array.&lt;number></span> </td> <td class="description last">An map version of entities, with key as entity ID and value as entity value.</td> </tr> <tr> <td class="name"><code>intent</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="description last">The matched intent.</td> </tr> <tr> <td class="name"><code>score</code></td> <td class="type"> <span class="param-type">number</span> </td> <td class="description last">The score of the matched sentence intent.</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="nlp_Sequential.js.html">nlp/Sequential.js</a>, <a href="nlp_Sequential.js.html#line388">line 388</a> </li></ul></dd> </dl> <h4 class="name" id="NlpResult">NlpResult</h4> <div class="description"> Describes a sentence classification and entities. </div> <h5>Type:</h5> <ul> <li> <span class="param-type">Object</span> </li> </ul> <h5 class="subsection-title">Properties:</h5> <table class="props"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>entities</code></td> <td class="type"> <span class="param-type">Array.&lt;<a href="global.html#Entity">Entity</a>></span> </td> <td class="description last">The ordered list of found entities.</td> </tr> <tr> <td class="name"><code>entitiesIndex</code></td> <td class="type"> <span class="param-type">Array.&lt;number></span> </td> <td class="description last">An map version of entities, with key as entity ID and value as entity value.</td> </tr> <tr> <td class="name"><code>intent</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="description last">The matched intent.</td> </tr> <tr> <td class="name"><code>score</code></td> <td class="type"> <span class="param-type">number</span> </td> <td class="description last">The score of the matched sentence intent.</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="nlp_Fuzzy.js.html">nlp/Fuzzy.js</a>, <a href="nlp_Fuzzy.js.html#line397">line 397</a> </li></ul></dd> </dl> <h4 class="name" id="regexEntityRecognizerCallback"><span class="type-signature"></span>regexEntityRecognizerCallback<span class="signature">(match)</span><span class="type-signature"> &rarr; {<a href="global.html#Entity">Entity</a>|undefined}</span></h4> <div class="description"> Called when RegexEntityRecognizer matches a regular expression. </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>match</code></td> <td class="type"> <span class="param-type">Array.&lt;string></span> </td> <td class="description last">The matched values.</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="entityrecognizers_RegexEntityRecognizer.js.html">entityrecognizers/RegexEntityRecognizer.js</a>, <a href="entityrecognizers_RegexEntityRecognizer.js.html#line92">line 92</a> </li></ul></dd> </dl> <h5>Returns:</h5> <ul> <li> <div class="param-desc"> The processed entity. </div> <dl> <dt> Type </dt> <dd> <span class="param-type"><a href="global.html#Entity">Entity</a></span> </dd> </dl> </li> <li> <div class="param-desc"> When the match found is not a valid entity. </div> <dl> <dt> Type </dt> <dd> <span class="param-type">undefined</span> </dd> </dl> </li> </ul> </article> </section> </div> <nav> <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Bravey.ApiAiAdapter.html">ApiAiAdapter</a></li><li><a href="Bravey.ContextManager.html">ContextManager</a></li><li><a href="Bravey.DocumentClassifier.html">DocumentClassifier</a></li><li><a href="Bravey.EMailEntityRecognizer.html">EMailEntityRecognizer</a></li><li><a href="Bravey.Filter.BasicFilter.html">BasicFilter</a></li><li><a href="Bravey.FreeTextEntityRecognizer.html">FreeTextEntityRecognizer</a></li><li><a href="Bravey.Language.EN.DateEntityRecognizer.html">DateEntityRecognizer</a></li><li><a href="Bravey.Language.EN.FreeTextEntityRecognizer.html">FreeTextEntityRecognizer</a></li><li><a href="Bravey.Language.EN.NumberEntityRecognizer.html">NumberEntityRecognizer</a></li><li><a href="Bravey.Language.EN.Stemmer.html">Stemmer</a></li><li><a href="Bravey.Language.EN.TimeEntityRecognizer.html">TimeEntityRecognizer</a></li><li><a href="Bravey.Language.EN.TimePeriodEntityRecognizer.html">TimePeriodEntityRecognizer</a></li><li><a href="Bravey.Language.IT.DateEntityRecognizer.html">DateEntityRecognizer</a></li><li><a href="Bravey.Language.IT.FreeTextEntityRecognizer.html">FreeTextEntityRecognizer</a></li><li><a href="Bravey.Language.IT.NumberEntityRecognizer.html">NumberEntityRecognizer</a></li><li><a href="Bravey.Language.IT.Stemmer.html">Stemmer</a></li><li><a href="Bravey.Language.IT.TimeEntityRecognizer.html">TimeEntityRecognizer</a></li><li><a href="Bravey.Language.IT.TimePeriodEntityRecognizer.html">TimePeriodEntityRecognizer</a></li><li><a href="Bravey.Language.PT.DateEntityRecognizer.html">DateEntityRecognizer</a></li><li><a href="Bravey.Language.PT.FreeTextEntityRecognizer.html">FreeTextEntityRecognizer</a></li><li><a href="Bravey.Language.PT.NumberEntityRecognizer.html">NumberEntityRecognizer</a></li><li><a href="Bravey.Language.PT.Stemmer.html">Stemmer</a></li><li><a href="Bravey.Language.PT.TimeEntityRecognizer.html">TimeEntityRecognizer</a></li><li><a href="Bravey.Language.PT.TimePeriodEntityRecognizer.html">TimePeriodEntityRecognizer</a></li><li><a href="Bravey.Nlp.Fuzzy.html">Fuzzy</a></li><li><a href="Bravey.Nlp.Sequential.html">Sequential</a></li><li><a href="Bravey.NumberEntityRecognizer.html">NumberEntityRecognizer</a></li><li><a href="Bravey.RegexEntityRecognizer.html">RegexEntityRecognizer</a></li><li><a href="Bravey.SessionManager.InMemorySessionManager.html">InMemorySessionManager</a></li><li><a href="Bravey.StringEntityRecognizer.html">StringEntityRecognizer</a></li><li><a href="Bravey.Text.RegexMap.html">RegexMap</a></li></ul><h3>Namespaces</h3><ul><li><a href="Bravey.html">Bravey</a></li><li><a href="Bravey.Data.html">Data</a></li><li><a href="Bravey.Date.html">Date</a></li><li><a href="Bravey.File.html">File</a></li><li><a href="Bravey.Filter.html">Filter</a></li><li><a href="Bravey.Language.html">Language</a></li><li><a href="Bravey.Language.EN.html">EN</a></li><li><a href="Bravey.Language.IT.html">IT</a></li><li><a href="Bravey.Language.PT.html">PT</a></li><li><a href="Bravey.Nlp.html">Nlp</a></li><li><a href="Bravey.SessionManager.html">SessionManager</a></li><li><a href="Bravey.Text.html">Text</a></li></ul><h3><a href="global.html">Global</a></h3> </nav> <br class="clear"> <footer> Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> </footer> <script> prettyPrint(); </script> <script src="scripts/linenumber.js"> </script> </body> </html>