npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

conjugate

v1.0.4

Published

Conjugate verbs correctly based on a pronoun

Downloads

21

Readme

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.