+4
-0
@@ -0,1 +1,5 @@ | ||
| === 0.0.4 2013-12-13 | ||
| * bugfix match() | ||
| === 0.0.3 2013-12-12 | ||
@@ -2,0 +6,0 @@ |
+8
-10
@@ -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 @@ }; |
+1
-1
| { | ||
| "name": "asearch", | ||
| "version": "0.0.3", | ||
| "version": "0.0.4", | ||
| "private": false, | ||
@@ -5,0 +5,0 @@ "description": "ambiguity text search", |
+1
-2
| # 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 @@ |
@@ -20,3 +20,2 @@ # Asearch = require 'Asearch' | ||
| console.log a.match 'chess', 2 # => false | ||
| console.log a.match 'burger', 4 # => false (but should be true) | ||
@@ -23,0 +22,0 @@ console.log "== example 3" |
6420
-1.37%104
-1.89%61
-1.61%