Skip to content
This repository has been archived by the owner on May 24, 2022. It is now read-only.

Commit

Permalink
Remove Object.assign for browser better compatibility.
Browse files Browse the repository at this point in the history
  • Loading branch information
haganbt committed May 23, 2017
1 parent 2ee4541 commit 1a84827
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
12 changes: 9 additions & 3 deletions dist/bayes-classifier.js

Large diffs are not rendered by default.

8 changes: 7 additions & 1 deletion lib/bayes-classifier.js
Expand Up @@ -321,7 +321,13 @@ BayesClassifier.prototype.getClassifications = function(doc) {
* @return {object} - Bayes classifier instance
*/
BayesClassifier.prototype.restore = function(classifier) {
Object.assign(this, classifier);
this.docs = classifier.docs;
this.lastAdded = classifier.lastAdded;
this.features = classifier.features;
this.classFeatures = classifier.classFeatures;
this.classTotals = classifier.classTotals;
this.totalExamples = classifier.totalExamples;
this.smoothing = classifier.smoothing;
this.stemmer = stemmer;
return this;
};
Expand Down

0 comments on commit 1a84827

Please sign in to comment.