From c88c3a21fcb0cfb1aa3e24eb1d4b6d5556e29e3c Mon Sep 17 00:00:00 2001 From: Kumar Priyansh Date: Mon, 31 Aug 2020 00:40:54 +0530 Subject: basic search logic --- app/css/style.css | 2 +- app/index.html | 3 ++- app/scripts/search.js | 10 ++++++++++ 3 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 app/scripts/search.js diff --git a/app/css/style.css b/app/css/style.css index 9853773..3031eb2 100644 --- a/app/css/style.css +++ b/app/css/style.css @@ -19,7 +19,7 @@ body { .search_box { position: absolute; - top: 40%; + top: 30%; left: 10%; width: 80%; } diff --git a/app/index.html b/app/index.html index 8a15388..40896a0 100644 --- a/app/index.html +++ b/app/index.html @@ -10,8 +10,9 @@
+ \ No newline at end of file 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); + }); +}); -- cgit v1.2.3