word-analyzer

An awesome module that analyze words moephologically

Usage no npm install needed!

<script type="module">
  import wordAnalyzer from 'https://cdn.skypack.dev/word-analyzer';
</script>

README

word-analyzer

This module morphologically analyze words entered as string.

'programmer' => 'noun'
'you are programming' => {
                            you: 'pronoun', 
                            are: 'verb', 
                            programming: 'noun'
                        }

Usage

It requires the external modules: "request", "request-promise" and "cheerio"

const phrase_analyzer = require('word-analyzer');

Methods

This module has one method:

  • analyze: return a string if the input in a only word o an object if it's a phrase

Example

analyze

Input:

const phrase_analyzer = require('word-analyzer');

const example1 = () => {
    phrase_analyzer.analyze('dance')
    .then(word => {
        console.log('1) ',word);
    })
    .catch()
}

const example2 = () => {
    phrase_analyzer.analyze('everybody want to program')
    .then(word => {
        console.log('2) ',object)
    })
    .catch()
}

example1()

example2()

Output:

1) verb

2) { everybody: 'pronoun',
     want: 'verb',
     to: 'preposition',
     program: 'noun' }