(function () { var template, target; function listExamples(examples) { target.innerHTML = ""; var node = template.process({ context: {examples: examples}, clone: true, parent: target }); document.getElementById("count").innerHTML = "(" + examples.length + ")"; } var timerId; function inputChange() { if (timerId) { window.clearTimeout(timerId); } var text = this.value; timerId = window.setTimeout(function() { filterList(text); }, 500); } function filterList(text) { var examples; if (text.length < 2) { examples = info.examples; } else { var words = text.split(/\W+/); var scores = {}; for(var i=0; i