aboutsummaryrefslogtreecommitdiff
path: root/app/scripts/search.js
diff options
context:
space:
mode:
Diffstat (limited to 'app/scripts/search.js')
-rw-r--r--app/scripts/search.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/app/scripts/search.js b/app/scripts/search.js
new file mode 100644
index 0000000..0b1f70f
--- /dev/null
+++ b/app/scripts/search.js
@@ -0,0 +1,10 @@
+const searchBox = document.getElementById('searchBox');
+const natural = require('natural');
+const wordnet = new natural.WordNet();
+
+searchBox.addEventListener('keyup', () => {
+ const word = searchBox.value;
+ wordnet.lookup(word, details => {
+ console.log(details);
+ });
+});