Comparing version 0.0.3 to 0.0.4
@@ -0,1 +1,5 @@ | ||
=== 0.0.4 2013-12-13 | ||
* bugfix match() | ||
=== 0.0.3 2013-12-12 | ||
@@ -2,0 +6,0 @@ |
@@ -5,3 +5,3 @@ (function() { | ||
module.exports = Asearch = (function() { | ||
var INITPAT, MAXCHAR; | ||
var INITPAT, INITSTATE, MAXCHAR; | ||
@@ -12,2 +12,4 @@ INITPAT = 0x80000000; | ||
INITSTATE = [INITPAT, 0, 0, 0]; | ||
Asearch.prototype.isupper = function(c) { | ||
@@ -65,3 +67,3 @@ return (c >= 0x41) && (c <= 0x5a); | ||
if (state == null) { | ||
state = null; | ||
state = INITSTATE; | ||
} | ||
@@ -71,5 +73,2 @@ if (str == null) { | ||
} | ||
if (state === null) { | ||
state = this.initstate(); | ||
} | ||
i0 = state[0]; | ||
@@ -94,6 +93,2 @@ i1 = state[1]; | ||
Asearch.prototype.initstate = function() { | ||
return [INITPAT, 0, 0, 0]; | ||
}; | ||
Asearch.prototype.match = function(str, ambig) { | ||
@@ -104,3 +99,6 @@ var s; | ||
} | ||
s = this.state(this.initstate(), str); | ||
s = this.state(INITSTATE, str); | ||
if (!(ambig < INITSTATE.length)) { | ||
ambig = INITSTATE.length - 1; | ||
} | ||
return (s[ambig] & this.acceptpat) !== 0; | ||
@@ -107,0 +105,0 @@ }; |
{ | ||
"name": "asearch", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"private": false, | ||
@@ -5,0 +5,0 @@ "description": "ambiguity text search", |
# Node Asearch | ||
ambiguity text search for JavaScript | ||
<img src="https://travis-ci.org/shokai/node-asearch.png"> | ||
<a href="https://travis-ci.org/shokai/node-asearch"><img src="https://travis-ci.org/shokai/node-asearch.png"></a> | ||
@@ -38,3 +38,2 @@ - https://github.com/shokai/node-asearch | ||
console.log a.match 'chess', 2 # => false | ||
console.log a.match 'burger', 4 # => false (but should be true, this is bug of current version) | ||
``` | ||
@@ -41,0 +40,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6420
104
61