rena.js
/*
	 * Keyword store using trie tree.
	 * @constructor
	 */
Keyword store using trie tree.
@constructor
Keyword store using trie tree . @constructor
function Trie(keywords) {
		var i,
			j,
			trie,
			ch;
		this._trie = {};
		for(i = 0; i < keywords.length; i++) {
			trie = this._trie;
			for(j = 0; j < keywords[i].length; j++) {
				ch = keywords[i].charAt(j);
				if(!trie[ch]) {
					trie[ch] = {};
				}
				trie = trie[ch];
			}
		}
	}
function Trie ( keywords ) { var i , j , trie , ch ; this . _trie = { } ; for ( i = 0 ; i < keywords . length ; i ++ ) { trie = this . _trie ; for ( j = 0 ; j < keywords [ i ] . length ; j ++ ) { ch = keywords [ i ] . charAt ( j ) ; if ( ! trie [ ch ] ) { trie [ ch ] = { } ; } trie = trie [ ch ] ; } } }
Keyword store using trie tree.
Keyword store using trie tree .