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

turkish-conjugator

v3.0.0

Published

Turkish conjugator for students!

Downloads

22

Readme

turkish-conjugator npm version

The first turkish conjugator without wrong conjugations ever made!

Getting Started

Install:

npm install turkish-conjugator --save

Use in your project:

const Conjugate = require('turkish-conjugator')

But since you're a cool guy you'll use:

import Conjugate from 'turkish-conjugator'

Also avaliable as a script tag:

<script src='https://unpkg.com/turkish-conjugator/dist/bundle.js'></script>

Methods

Conjugate.it(verb)

Arguments:

verb (string) : A Turkish verb in its positive form like: gelmek, izin vermek, istemek, yaşamak...

Returns:

This method returns an array of objects with the following structure:

[
  {
    tense: string,
    title: string,
    conjugation: {
      positive: array,
      negative: array
    }
  },
  ...
]

There will be 10 objects and each of them will contain the tense, the title and an object containing the negative and positive conjugation of the given verb. Example using the verb gelmek:

{
  "tense": "aorist",
  "title": "Aorist",
  "conjugation": {
    "positive": ["gelirim", "gelirsin", "gelir", "geliriz", "gelirsiniz", "gelirler"],
    "negative": ["gelmem", "gelmezsin", "gelmez", "gelmeyiz", "gelmezsiniz", "gelmezler"]
  }
}

Here you can see a full example of the output for Conjugate.it('gelmek')

These are the supported tenses:

Aorist, Gerund (Present Continuous), Future, Simple Past, Miş Past, Past Continuous, Present Indefinite, Gerund Indefinite, Future Indefinite, Potential.

Conjugate.verify

This is an object containing methods to validate if a given string is a correct Turkish verb. This object contains 4 methods:

  • .isAlphabeticallyValid(verb)

Arguments:

verb (string) : A Turkish verb in any form like: gelmek, izin vermek, istememek, yaşamamak...

Returns:

This method returns a boolean indicating whether a string is alphabetically valid according to the Turkish alphabet. If the returned value of this function is true it means the verb is alphabetically valid, if the returned value is false then it is not. (Duuh...)

  • .isNegativeVerb(verb)

Arguments:

verb (string) : A Turkish verb in its negative form like: gelmemek, izin vermemek, istememek, yaşamamak...

Returns:

This method returns a boolean indicating whether a verb is a negative. For example: gelmemek returns true and gelmek returns false.

  • .isVerb(verb)

Arguments:

verb (string) : A Turkish verb in any form like: gelmek, izin vermek, istememek, yaşamamak...

Returns:

This method returns a boolean indicating whether a string is a Turkish verb in its negative or positive form. For example: gelmemek returns true and gelmek returns true. Since this methods only checks if the verb/string ends with mak, mek, mamak, or memek a string like xmak will return true. To verify if a string is truly a Turkish verb that follows every rule use the method .isTurkishVerb instead.

  • .isTurkishVerb(verb)

Arguments:

verb (string) : A Turkish verb in any form like: gelmek, izin vermek, istememek, yaşamamak...

Returns:

This method returns a boolean or a string. if the given verb is invalid and does not follow every Turkish rule about verbs and their structure then it will return false. if the given string is a Turkish verb in its negative form (like gelmemek), it will return the given verb in its positive form (gelmemek -> gelmek). If the given verb is in its positive form this same verb will be returned.

Examples:

Conjugate.verify.isTurkishVerb('gelmek') // 'gelmek'

Conjugate.verify.isTurkishVerb('gelmemek') // 'gelmek'

Conjugate.verify.isTurkishVerb('GelMemEK') // 'gelmek'

Conjugate.verify.isTurkishVerb('xmek') // false

Conjugate.verify.isTurkishVerb('gelmekk') // false

At Konjüsh this method's result is used as input for Conjugate.it in this way:

const isTurkishVerb = Conjugate.verify.isTurkishVerb('gelmek');
if(isTurkishVerb) {
  Conjugate.it(isTurkishVerb);
} else {
  // Show up an invalid Turkish verb message.
}

Conjugate.utils

This is an object containing methods to interact with Turkish verbs. This object contains 2 methods:

  • .convertToNegativeVerb(verb)

Arguments:

verb (string) : A Turkish verb in its positive form like: gelmek, izin vermek, istemek, yaşamak...

Returns:

This method returns a string which will be the given verb in its negative form (gelmek -> gelmemek).

  • .convertToPositiveVerb(verb)

Arguments:

verb (string) : A Turkish verb in its negative form like: gelmemek, izin vermemek, istememek, yaşamamak...

Returns:

This method returns a string which will be the given verb in its positive form (gelmemek -> gelmek).