diff --git a/lib/backends/localStorage.js b/lib/backends/localStorage.js index 949cd00..0410643 100644 --- a/lib/backends/localStorage.js +++ b/lib/backends/localStorage.js @@ -1,7 +1,7 @@ var _ = require("underscore")._; var LocalStorageBackend = function(options) { - var options = options || {}; + options = options || {}; var name = options.name || Math.floor(Math.random() * 100000); this.prefix = 'classifier.bayesian.' + name; @@ -61,7 +61,7 @@ LocalStorageBackend.prototype = { toJSON : function() { var words = {}; - var regex = new RegExp("^" + this.prefix + "\.words\.(.+)$") + var regex = new RegExp("^" + this.prefix + "\\.words\\.(.+)$") for (var item in this.storage) { var match = regex.exec(item); if (match) {