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

vocabulary-level-grader

v1.1.0

Published

Analyzes the given text and determine what's the vocabulary level based on CEFR levels

Downloads

490

Readme

Vocabulary Level Grader

Analyzes the given text and determines what's the vocabulary level based on CEFR levels.

Features

  • Calculates Arithmetic mean of vocabulary ranks of the text.
  • Calculates Maximum of vocabulary ranks of the text.
  • Grades text vocabulary level based on CEFR levels

Install

Using Yarn:

yarn add vocabulary-level-grader

Using NPM:

npm i --save vocabulary-level-grader

Usage

const grade = require('vocabulary-level-grader');

const result = grade(`
    It was the hunter's first time outside Montana.
    He woke, stricken still with the hours-old vision of ascending through rose-lit cumulus,
    of houses and barns like specks deep in the snowed-in valleys,
    all the scrolling country below looking December—brown and black hills streaked with snow,
    flashes of iced-over lakes,
    the long braids of a river gleaming at the bottom of a canyon.
    Above the wing the sky had deepened to a blue so pure he knew it would bring tears to his eyes if he looked long enough.
`);

console.log(result);

logs:

{
    "meta": {
        "words": 59,
        "grade": "C2",
        "mean": 2004.7796610169491,
        "max": 9874,
        "levels": {
            "A1": 35.714285714285715,
            "A2": 42.857142857142854,
            "B1": 53.57142857142857,
            "B2": 71.42857142857143,
            "C1": 85.71428571428571,
            "C2": 100
        }
    },
    "words": [
        ["with", 2],
        ["snow", 2],
        ["look", 2],
        ["long", 2],
        ["december", 1],
        ["enough", 1],
        ["hill", 1],
        ["hunter", 1],
        ["streak", 1],
        ["still", 1],
        ["flash", 1],
        ["hour", 1],
        ["ice", 1],
        ["vision", 1],
        ["over", 1],
        ["through", 1],
        ["lake", 1],
        ["lit", 1],
        ["time", 1],
        ["barn", 1],
        ["braid", 1],
        ["deep", 1],
        ["river", 1],
        ["valley", 1],
        ["gleam", 1],
        ["scroll", 1],
        ["bottom", 1],
        ["below", 1],
        ["canyon", 1],
        ["first", 1],
        ["above", 1],
        ["black", 1],
        ["wing", 1],
        ["old", 1],
        ["sky", 1],
        ["rose", 1],
        ["deepen", 1],
        ["like", 1],
        ["blue", 1],
        ["all", 1],
        ["pure", 1],
        ["outside", 1],
        ["stricken", 1],
        ["eye", 1],
        ["tear", 1],
        ["bring", 1],
        ["knew", 1],
        ["ascend", 1],
        ["brown", 1],
        ["country", 1],
        ["woke", 1],
        ["house", 1]
    ]
}

Reference

  • https://languagelearning.stackexchange.com/a/3065