diff --git a/lib/natural/util/bag.js b/lib/natural/util/bag.js index c5ddb3c25..360d90e24 100644 --- a/lib/natural/util/bag.js +++ b/lib/natural/util/bag.js @@ -28,6 +28,7 @@ function Bag() { Bag.prototype.add = function(element) { this.dictionary.push(element); + this.nElement++; return this; };