diff --git a/test/test-nlp.js b/test/test-nlp.js new file mode 100644 index 0000000..608bb7b --- /dev/null +++ b/test/test-nlp.js @@ -0,0 +1,47 @@ +/* Text analyzer (compromise) */ +var dialog = [ + 'The fox hunts the egg,', + 'Do you know how old the earth is?', + 'I like gray roses', + 'Do you dream neon black and think about it?' , + 'The opera about richard nixon visiting china', + 'Where am I?', + 'Where do I live?', + 'I like roses wherever they grow', + 'Who are you?', + 'How old are you?', + 'I want to go to the stadion. Show me the way.', + 'Please, show me the way to the stadion', + 'I am on the way', +] + +var parsers = dialog.map(function (sentence) { return nlp(sentence) }); + + +parsers[0].verbs().toNegative(); +print(dialog[0],parsers[0].text()); + +var classification=[]; +for(var i=0;i