Skip to content

Commit

Permalink
Fixed small typo in documentation
Browse files Browse the repository at this point in the history
When loading a classifier from a raw JSON string the JSON string needs
to be parsed first.
  • Loading branch information
Jonathan Kim committed Sep 3, 2012
1 parent 60d1f9b commit 2920692
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -198,7 +198,7 @@ A classifier can also be serialized and deserialized like so:
// serialize // serialize
var raw = JSON.stringify(classifier); var raw = JSON.stringify(classifier);
// deserialize // deserialize
var restoredClassifier = natural.BayesClassifier.restore(raw); var restoredClassifier = natural.BayesClassifier.restore(JSON.parse(raw));
console.log(restoredClassifier.classify('i should sell that')); console.log(restoredClassifier.classify('i should sell that'));


Phonetics Phonetics
Expand Down

0 comments on commit 2920692

Please sign in to comment.