word-analyzer

1.0.5 • Public • Published

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' }

Package Sidebar

Install

npm i word-analyzer

Weekly Downloads

7

Version

1.0.5

License

ISC

Unpacked Size

8.33 kB

Total Files

4

Last publish

Collaborators

  • amanda-hg