Skip to content

Commit

Permalink
docs(wink-ner): complete documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
sanjayaksaxena committed Jun 20, 2018
1 parent 214f21e commit ed929a1
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/wink-ner.js
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,20 @@ var ner = function () {
return { nti: i };
}; // getNextNTokens()

// ### lookup
/**
* @private
* Exports the JSON of the learnings generated by `learn()`, which may be
* saved in a file that may be used later for NER purpose.
*
* @param {number} i — index of tokens, from where the lookup is performed.
* @param {object[]} tokens — input tokens to NER.
* @param {object} candidate — result of lookup in `uniWordEntities`.
* @param {array} nerdts — NERed tokens.
* @return {number} of the learnings.
* @example
* var learnings = myNER.exportJSON();
*/
var lookup = function ( i, tokens, candidate, nerdts ) {
var result;
for ( var k = 0, kmax = candidate.wordCounts.length; k < kmax; k += 1 ) {
Expand Down Expand Up @@ -542,6 +556,13 @@ var ner = function () {
return ( nerdts );
}; // recognize()

// ### initialize
/**
* @private
* Initalizes the config and learning related variables.
*
* @return {undefined} of the learnings.
*/
var initialize = function ( ) {
// Define default configuration.
// Ignore `punctuation`;
Expand Down

0 comments on commit ed929a1

Please sign in to comment.