@@ -79,11 +79,11 @@ var printTokens = require( './api/print-tokens.js' );
7979 * developer APIs.
8080 *
8181 * @param {object } docData It encapsulates the document data.
82- * @param {object } wordVectors Word vector, optional .
82+ * @param {object } addons The model's addon, may contain word vectors, stemmer etc .
8383 * @return {object } conatining APIs.
8484 * @private
8585 */
86- var doc = function ( docData , wordVectors ) {
86+ var doc = function ( docData , addons ) {
8787 // Extract `cache` as it is frequently accessed.
8888 var cache = docData . cache ;
8989
@@ -158,7 +158,7 @@ var doc = function ( docData, wordVectors ) {
158158 // Markup this token.
159159 api . markup = ( beginMarker , endMarker ) => markings . push ( [ index , index , beginMarker , endMarker ] ) ;
160160 // Output this token or its properties using mapper function — `f`.
161- api . out = ( f ) => itmTokenOut ( index , docData , f , wordVectors ) ;
161+ api . out = ( f ) => itmTokenOut ( index , docData , f , addons ) ;
162162 // Access the parent sentence.
163163 api . parentSentence = ( ) => getParentItem ( index , sentences , itemSentence ) ;
164164 // Index within the document.
@@ -188,7 +188,7 @@ var doc = function ( docData, wordVectors ) {
188188 api . length = ( ) => ( selectedTokens . length ) ;
189189 // Output this collection of selected tokens as a reduced values or properties
190190 // using map/reduce functions — `f/g`.
191- api . out = ( f , g ) => selTokensOut ( selectedTokens , docData , f , g , wordVectors ) ;
191+ api . out = ( f , g ) => selTokensOut ( selectedTokens , docData , f , g , addons ) ;
192192 return api ;
193193 } ; // colTokens()
194194
@@ -217,7 +217,7 @@ var doc = function ( docData, wordVectors ) {
217217 api . length = ( ) => ( end - start + 1 ) ;
218218 // Output this token collection as a reduced values or properties using
219219 // map/reduce functions — `f/g`.
220- api . out = ( f , g ) => colTokensOut ( start , end , docData , f , g , wordVectors ) ;
220+ api . out = ( f , g ) => colTokensOut ( start , end , docData , f , g , addons ) ;
221221
222222 return api ;
223223 }
@@ -409,7 +409,7 @@ var doc = function ( docData, wordVectors ) {
409409 // Markup this sentence.
410410 api . markup = ( beginMarker , endMarker ) => markings . push ( [ sentences [ index ] [ 0 ] , sentences [ index ] [ 1 ] , beginMarker , endMarker ] ) ;
411411 // Output this sentence as text.
412- api . out = ( f ) => itmSentenceOut ( index , docData , f , wordVectors ) ;
412+ api . out = ( f ) => itmSentenceOut ( index , docData , f , addons ) ;
413413 // Outputs the collection of entities, if any, contained in this sentence.
414414 api . entities = ( ) => colSelectedEntities ( containedEntities ( entities , sentences [ index ] [ 0 ] , sentences [ index ] [ 1 ] ) ) ;
415415 // Outputs the collection of custom entities, if any, contained in this sentence.
@@ -438,7 +438,7 @@ var doc = function ( docData, wordVectors ) {
438438 // Length of this collection.
439439 api . length = ( ) => ( sentences . length ) ;
440440 // Output this collection of sentences as an array of strings.
441- api . out = ( f ) => colSentencesOut ( docData , f , wordVectors ) ;
441+ api . out = ( f ) => colSentencesOut ( docData , f , addons ) ;
442442 return api ;
443443 } ; // colSentences()
444444
@@ -450,7 +450,7 @@ var doc = function ( docData, wordVectors ) {
450450 methods . customEntities = colCustomEntities ;
451451 methods . isLexeme = isLexeme ;
452452 methods . isOOV = cache . isOOV ;
453- methods . out = ( f ) => itmDocumentOut ( docData , f , wordVectors ) ;
453+ methods . out = ( f ) => itmDocumentOut ( docData , f , addons ) ;
454454 methods . sentences = colSentences ;
455455 methods . tokens = colTokens ( 0 , docData . numOfTokens - 1 ) ;
456456
0 commit comments