projects
/
Pman.Core
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
skip invalid files
[Pman.Core]
/
Pman.SearchTokenizer.js
diff --git
a/Pman.SearchTokenizer.js
b/Pman.SearchTokenizer.js
index
5882e36
..
8db0be1
100644
(file)
--- a/
Pman.SearchTokenizer.js
+++ b/
Pman.SearchTokenizer.js
@@
-14,8
+14,8
@@
Pman.SearchTokenizer = function(s)
{
Pman.SearchTokenizer = function(s)
{
- this.str =
s
;
- this.strlen =
s.length
;
+ this.str =
typeof(s) == 'string' ? s : ''
;
+ this.strlen =
typeof(s) == 'string' ? s.length : 0
;
this.i = 0;
this.tokens = [];
//print_r(this);
this.i = 0;
this.tokens = [];
//print_r(this);
@@
-49,6
+49,10
@@
Pman.SearchTokenizer.prototype = {
}
}
}
}
+ // sort tokens longest first..
+
+
+
// should not get here...
return this.tokens;
},
// should not get here...
return this.tokens;
},
@@
-116,7
+120,7
@@
Pman.SearchTokenizer.prototype = {
return;
}
}
return;
}
}
- this.tokens.push( { type : 's' , v : s });
+ this.tokens.push( { type : 's' , v : s
, q: q
});
},
getChar : function ()
},
getChar : function ()
@@
-137,7
+141,7
@@
Pman.SearchTokenizer.prototype = {
};
Pman.SearchTokenizer.parse = function(v) {
};
Pman.SearchTokenizer.parse = function(v) {
- var x = new Pman.SearchTokenizer();
+ var x = new Pman.SearchTokenizer(
v
);
return x.parse();
}
\ No newline at end of file
return x.parse();
}
\ No newline at end of file