Git Product home page Git Product logo

wordhelper's Introduction

Word Helper

I enjoy crosswords, but sometimes I cant find (or don't even know) a valid word, to make my life easier, instead of going online or looking in a dictionary I automated the looking with Python.

Quick Demo:

word_helper

The Problem that inspired me:

In the below examples I have used a popular word puzzle app in Bulgaria that I play.
The mobile app has some random letters and the goal is to create a valid word.
Problem is often you get stuck on a word and to get a hint, you need to spend money.

app


How to run:

You can clone this repository and run the main.py file.
First you need to be in the cloned repository and then you can run:

py main.py

Creating a virtual environment is recommended, you can create like this

py -m venv venv

Usage:

  1. In the dropdown menu choose the desired length of the output words.
  2. Enter the letter sequence in the text input bar.
  3. Click the Generate button.
Program output Crossword
program with 3 letters crossword
program with 4 letters crossword
program with 5 letter crossword

Additional functionality:

* Cache functionality

The cache functionality uses a Python dictionary to cache previous queries, future quires that are stored in the dictionary are instantly returned.

* Validation

This functionality validates the inputs displays the appropriate error message if any are wrong.

* File Manager

The file manager system manages the txt files containing all the words.

  • A script called length_splitter splits the words from the base txt file in to length specific files containing only words with equal lengths, this limits the search only to words with the same length as the desired one. All the separate length files are present by default.
    To run the script use:
    py .\valid_words\lenght_splitter.py

How it works:

This program uses a txt file of bulgarian words, when a query is made with a sequence of elements and a specific length, a permutation function is called and all permutations with the given length are created and stored in a list, a validate word function is called and a loop runs through the list of validated words, and checks if any of them match the permutations.


Constraints:

While the program uses a list of 230k+ validated Bulgarian words, some of the mobile app's words may not appear in the words list.


wordhelper's People

Contributors

pepk0 avatar

Stargazers

 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.