Giter VIP home page Giter VIP logo

is-word's Introduction

Built with love

is-word

Checks if a word exists in a language. Currently supports 10 languages. Uses tries to get very fast results.

Installation

$ npm install is-word

Usage

var isWord = require('is-word');
var englishWords = isWord('american-english');

console.log(englishWords.check('direction')); // true
console.log(englishWords.check('asddsaaaa')); // false

isWord() returns an object having a trie of the configured language. The object has check method which returns a boolean value if a word is present in a language or not.

Configure

To change the languages,

american-english - isWord('american-english');

brazilian - isWord('brazilian');

british-english - isWord('british-english');

french - isWord('french');

italian - isWord('italian');

ngerman - isWord('ngerman');

ogerman - isWord('ogerman');

portuguese - isWord('portuguese');

spanish - isWord('spanish');

swiss - isWord('swiss');

Why is-word ?

is-word is very fast compared to existing checkers which use a regex for all available words. is-word uses tries data structure which causes comparisons to be done very quickly. Trie creation takes some time but if there are a lot of words to be checked then is-word is way ahead than others.

Features and Contributions

is-word was initially created for testing inconsistencies and mistakes in translations but can be expanded to much more. So if you have any feature suggestions feel free to open a PR.

Though I have tested the code against a lot of test cases, still if you find a bug, feel free to raise an issue.

is-word's People

Contributors

nimishagarwal76 avatar romainreghem 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.