Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

conjugate

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

conjugate

Conjugate verbs correctly based on a pronoun

  • 1.0.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
6
decreased by-14.29%
Maintainers
1
Weekly downloads
 
Created
Source

Build Status downloads npm Code Climate Test Coverage dependencies Size

conjugate

Conjugate verbs correctly based on a pronoun

Installation

npm install --save conjugate

Summary

Pass a pronoun and verb to conjugate, and it will return the verb conjugated for that pronoun.

var conjugate = require('conjugate');
console.log(conjugate('he', 'run')); // 'runs'

Usage

Node

This is, for now, a one way conjugator. You must pass in the infinitive form of a verb (with or without "to") to get a correct conjugation. E.g.

conjugate('I', 'run');

or

conjugate('I', 'to run');

but not

conjugate('I', 'runs');

The latter would return "runs." This is probably not what you want. It would be nice for this library to, eventually, parse a verb in any form and conjugate it to the perspective desired (or even back to the infinitive). The problem is that this is much harder to do (if a verb ends in "s," is it an already conjugated verb like "runs" or simply a verb that ends in "s" like "pass"), and frankly, the module I wrote this for does not require this functionality.

I tried to find all the unusual verb forms I could, so many irregular verbs should still conjugate correctly, e.g.:

conjugate('he', 'do') // he does
conjugate('she', 'spy') // he spies
conjugate('it', 'buzz') // he buzzes

// and even
conjugate('I', 'be') // I am

but there are three caveats. First, it's not impossible that I missed cases, so please open pull requests if you find verbs that don't conjugate correctly. Second, some words don't conjugate (see defective verbs), but this module does not attempt to detect these or do anything special with them. For instance, conjugate('he', 'beware') will return 'bewares,' which is not an actual verb. The problem is, what do you return if the word does not exist? Nothing? There's no good answer. Third, this module does not verify words against a dictionary or anything like that, so if you pass nonsense, it will be conjugated according the same parsing rules. E.g. conjugate('she', 'blergifo') will return 'blergifoes.' I guess this could be considered a feature if you are wanting to make up your own words. ¯\(ツ)

You can also make conjugate return the pronoun and conjugated verb together by passing true (for "append") as the third parameter.

conjugate('he', 'be', true) // he is

Browser

Serve either dist/conjugate.js or dist/conjugate.min.js however you serve javascript in your application, and then use window.conjugate (or just conjugate) to access the library on the client-side.

Contributing

Please see the contribution guidelines.

Keywords

FAQs

Package last updated on 31 Jul 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc