GithubHelp home page GithubHelp logo

theplatinum / english-permutation Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 1.38 MB

Performs a permutation of the input string and returns only valid English words that can be formed from the letters

JavaScript 100.00%
english permutation permutation-algorithms

english-permutation's Introduction

english-permutation

npm npm

Performs a permutation of the input string and returns only valid English words that can be formed from the letters

Installation

yarn add english-permutation

or

npm install english-permutation

How to use

import permutate from 'english-permutation'

console.log(await permutate('ABS'));

# result will be a promise that resolves to an array:
[ 'ABS', 'BAS', 'SAB' ]

An empty search will return null as a string

Breaking Change

The package now produces a promise that resolves to the result. You should use it as such in you code to await the result.

Contributions

Contributions are welcome via Pull Requests on Github.

Issues

Please report any issue you encounter in using the package through the issues tab Github Issues

Possible Upcoming improvements:

  • Implement a limit on the number of permutations generated to prevent the algorithm from generating too many permutations and causing performance issues.
  • Optimize the permutation algorithm.
  • Use a more efficient data structure to store the permutations, maybe hash set instead of an array, as it allows for faster insertion, retrieval, and membership testing.
  • Optimize the filter function by using a more efficient algorithm to match the regular expression, such as using a trie data structure to match the regular expression.
  • Maybe Add words meaning (Make into a web API)


credits: atebits/words. for the list of English words

english-permutation's People

Contributors

theplatinum avatar

Stargazers

 avatar  avatar

Watchers

 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.