Giter Club home page Giter Club logo

vocabulary-level-grader's Introduction

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

vocabulary-level-grader's People

Contributors

dependabot[bot] avatar ziaenezhad avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.