tense-builder

2.1.1 • Public • Published

Tests

Tense Builder

Instalation

npm i tense-builder -S

Usage

Parse mode

const TenseBuilder = require('tene-builder')
const tenseBuilder = new TenseBuilder()
tenseBuilder.config.space = '-'

const result = tenseBuilde.build('places-or-regions-with-hot-climate-and-low-racism-ubicated-in-romania-or-barcelona')

console.log(result)

// output is:
/*
[
    {
        word: 'places',
        type: 'subject',
        mood: 'or',
    },
    {
        word: 'regions',
        type: 'subject',
        mood: 'or',
    },
    {
        word: 'hot climate',
        type: 'what',
        mood: 'and',
    },
    {
        word: 'low racism',
        type: 'what',
        mood: 'and',
    },
    {
        word: 'romania',
        type: 'where',
        mood: 'or',
    },
    {
        word: 'barcelona',
        type: 'where',
        mood: 'or',
    },
]
*/

Build mode

const TenseBuilder = require('tene-builder')
const tenseBuilder = new TenseBuilder()

tenseBuilder.config.space = '-'

const parts = [
    {
        word: 'places',
        type: 'subject',
        mood: 'or',
    },
    {
        word: 'regions',
        type: 'subject',
        mood: 'or',
    },
    {
        word: 'hot climate',
        type: 'what',
        mood: 'and',
    },
    {
        word: 'low racism',
        type: 'what',
        mood: 'and',
    },
    {
        word: 'romania',
        type: 'where',
        mood: 'or',
    },
    {
        word: 'barcelona',
        type: 'where',
        mood: 'or',
    },
]

const result = tenseBuilde.build(parts)

console.log(result)
// output is: 
/*
    "places-or-regions-with-hot-climate-and-low-racism-ubicated-in-romania-or-barcelona"
*/

Types

"subject" your subject

"what" for stuff

"whatNegative" for negate stuff

"where" for ubications

Moods

"or" / "and"

Readme

Keywords

none

Package Sidebar

Install

npm i tense-builder

Weekly Downloads

1

Version

2.1.1

License

ISC

Unpacked Size

18.6 kB

Total Files

6

Last publish

Collaborators

  • luisresco