wordler-cli


Namewordler-cli JSON
Version 0.0.1 PyPI version JSON
download
home_pageNone
SummaryWordle solver!
upload_time2024-08-22 20:46:50
maintainerNone
docs_urlNone
authorKevin Schattin
requires_python>=3.9
licenseMIT License Copyright (c) 2024 Kevin Schattin Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Wordler!
Wordler! is an app for solving Wordle puzzles. In its current form, Wordler! is a 
command line interface (CLI) app, but work on a web app is underway, too. 

Using Wordler! is pretty straightforward. First, you provide your initial guess to the
app, and then it will ask if this initial guess solved the possible. If the puzzle has 
not been solved, the app will then ask for Wordle's feedback on the guess. Wordler! 
will display the letter in the guess, and you'll select which letters Wordle has 
highlighted green and which letters Wordle has highlighted yellow. 

Wordler! will then take this information and provide you with a new guess - along with 
a probability that this guess is the answer to the puzzle - to enter into Wordle. It 
will then go through the same steps of asking if the puzzle has been solved, and if 
not asking for the green and yellow tiles. Wordler! solves the puzzle almost all of 
the time, and on average, takes about 3.65 guess (including your initial guess) to find 
the correct word.

Check out the example of Wordler! solving the puzzle for the word "meter" below:

![](assets/Wordler!.gif)

# Installation
The Wordler! CLI app has been published to PyPI and can be installed with PIP. 
```
pip install wordler-cli
```

You can also build the CLI app directly from source by running the following in an 
environment of your choosing:
```
pip install git+https://github.com/k-bartolomeo/wordler.git
```

# Methodology
Wordler! starts off with sets of all possible letters for each position in a word. As
it receives feedback from the Wordle game itself, it will update these sets of letters. 
For example, if the correct word is `meter` and the guess word is `tried`, Wordle will 
mark the `e` in `tried` green and the `t` and the `r` yellow. After receiving this 
information from the user, Wordler! will then update the set of possible letters for 
each position as follows:
- Remove `t` from the set of possible letters for the first position.
- Remove `r` from the set of possible letters for the second position.
- Reduce the set for the fourth position to just the letter `e`, since that is the 
correct letter.
- Remove the letters `i` and `d` from all position sets since they are not in the 
goal word.
- Update the set of letters that must be included in the next guess to include `t`, 
`r`, and `e` if they are not present in the set already.

From there, Wordler! will update the list of remaining possible words based on the 
letters available for each position. Then, it will compute a probability for each 
remaining word using a combination of letter probabilities given word positions, 
transition probabilities from one letter to the next, and usage probabilities. The 
need for the first two probabilities is pretty self-evident; the inclusion of the 
usage probabilities, on the other hand, is based on the assumption that the NY Times 
editor choosing the Wordle words will be more likely to choose words that are used 
more often, as opposed to words with which the general public may be less familiar.

As far as the calculation of these various probabilities goes, the letter probabilities 
given the word positions are computed using counts of each letter in each position in 
the words in the Wordle corpus. Similar counts from the words in the Wordle corpus are 
used for the transition probabilities. These transition counts also consider word 
position in order to account for the fact that the probability of a transition, for 
example, from `letter 1` to `letter 2` might be higher if `letter 1` is the first letter
in the word instead of the third letter in the word. Usage probabilities are taken from 
[this subset](https://www.kaggle.com/datasets/rtatman/english-word-frequency) of usage 
counts derived from the Google Web Trillion Word Corpus.

# Web App
A web application that offers the same functionality as the CLI, albeit in a more 
aesthetically pleasing manner, is currently under development. This application is being 
built using mostly Python and the Dash framework, with a small bit of JavaScript sprinkled
in. The basic layout of the application is pictured below, and the code that has been 
written for the app thus far can be found on the `app-dev` branch of this repository.

![](<assets/Wordler! App.png>)

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "wordler-cli",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": null,
    "author": "Kevin Schattin",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/e0/65/393cce3cbec2b799b5d9a7aa7954359fae5d67a11f909fb5cfbec5ca93c1/wordler_cli-0.0.1.tar.gz",
    "platform": null,
    "description": "# Wordler!\nWordler! is an app for solving Wordle puzzles. In its current form, Wordler! is a \ncommand line interface (CLI) app, but work on a web app is underway, too. \n\nUsing Wordler! is pretty straightforward. First, you provide your initial guess to the\napp, and then it will ask if this initial guess solved the possible. If the puzzle has \nnot been solved, the app will then ask for Wordle's feedback on the guess. Wordler! \nwill display the letter in the guess, and you'll select which letters Wordle has \nhighlighted green and which letters Wordle has highlighted yellow. \n\nWordler! will then take this information and provide you with a new guess - along with \na probability that this guess is the answer to the puzzle - to enter into Wordle. It \nwill then go through the same steps of asking if the puzzle has been solved, and if \nnot asking for the green and yellow tiles. Wordler! solves the puzzle almost all of \nthe time, and on average, takes about 3.65 guess (including your initial guess) to find \nthe correct word.\n\nCheck out the example of Wordler! solving the puzzle for the word \"meter\" below:\n\n![](assets/Wordler!.gif)\n\n# Installation\nThe Wordler! CLI app has been published to PyPI and can be installed with PIP. \n```\npip install wordler-cli\n```\n\nYou can also build the CLI app directly from source by running the following in an \nenvironment of your choosing:\n```\npip install git+https://github.com/k-bartolomeo/wordler.git\n```\n\n# Methodology\nWordler! starts off with sets of all possible letters for each position in a word. As\nit receives feedback from the Wordle game itself, it will update these sets of letters. \nFor example, if the correct word is `meter` and the guess word is `tried`, Wordle will \nmark the `e` in `tried` green and the `t` and the `r` yellow. After receiving this \ninformation from the user, Wordler! will then update the set of possible letters for \neach position as follows:\n- Remove `t` from the set of possible letters for the first position.\n- Remove `r` from the set of possible letters for the second position.\n- Reduce the set for the fourth position to just the letter `e`, since that is the \ncorrect letter.\n- Remove the letters `i` and `d` from all position sets since they are not in the \ngoal word.\n- Update the set of letters that must be included in the next guess to include `t`, \n`r`, and `e` if they are not present in the set already.\n\nFrom there, Wordler! will update the list of remaining possible words based on the \nletters available for each position. Then, it will compute a probability for each \nremaining word using a combination of letter probabilities given word positions, \ntransition probabilities from one letter to the next, and usage probabilities. The \nneed for the first two probabilities is pretty self-evident; the inclusion of the \nusage probabilities, on the other hand, is based on the assumption that the NY Times \neditor choosing the Wordle words will be more likely to choose words that are used \nmore often, as opposed to words with which the general public may be less familiar.\n\nAs far as the calculation of these various probabilities goes, the letter probabilities \ngiven the word positions are computed using counts of each letter in each position in \nthe words in the Wordle corpus. Similar counts from the words in the Wordle corpus are \nused for the transition probabilities. These transition counts also consider word \nposition in order to account for the fact that the probability of a transition, for \nexample, from `letter 1` to `letter 2` might be higher if `letter 1` is the first letter\nin the word instead of the third letter in the word. Usage probabilities are taken from \n[this subset](https://www.kaggle.com/datasets/rtatman/english-word-frequency) of usage \ncounts derived from the Google Web Trillion Word Corpus.\n\n# Web App\nA web application that offers the same functionality as the CLI, albeit in a more \naesthetically pleasing manner, is currently under development. This application is being \nbuilt using mostly Python and the Dash framework, with a small bit of JavaScript sprinkled\nin. The basic layout of the application is pictured below, and the code that has been \nwritten for the app thus far can be found on the `app-dev` branch of this repository.\n\n![](<assets/Wordler! App.png>)\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2024 Kevin Schattin  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
    "summary": "Wordle solver!",
    "version": "0.0.1",
    "project_urls": {
        "Homepage": "https://github.com/k-bartolomeo/wordler",
        "Issues": "https://github.com/k-bartolomeo/wordler/issues"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "914c83751945f3c50b4eb3e5bbc4242733b17f24d816a83d27839180af0fab2a",
                "md5": "5e9e2812cfc5ddf82635ac6563c22fe9",
                "sha256": "d0f4ac1a7945c724890deedc61df42297300ae3dd51163e5cfe7cef0dcdfa633"
            },
            "downloads": -1,
            "filename": "wordler_cli-0.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "5e9e2812cfc5ddf82635ac6563c22fe9",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 32118,
            "upload_time": "2024-08-22T20:46:47",
            "upload_time_iso_8601": "2024-08-22T20:46:47.156637Z",
            "url": "https://files.pythonhosted.org/packages/91/4c/83751945f3c50b4eb3e5bbc4242733b17f24d816a83d27839180af0fab2a/wordler_cli-0.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e065393cce3cbec2b799b5d9a7aa7954359fae5d67a11f909fb5cfbec5ca93c1",
                "md5": "c61ab73e8e856c8293d4f4e273549403",
                "sha256": "076bef5c9055657565d459a64b05d54f8a778c1b6811e0adb4c205db76be52c8"
            },
            "downloads": -1,
            "filename": "wordler_cli-0.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "c61ab73e8e856c8293d4f4e273549403",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 33123,
            "upload_time": "2024-08-22T20:46:50",
            "upload_time_iso_8601": "2024-08-22T20:46:50.192692Z",
            "url": "https://files.pythonhosted.org/packages/e0/65/393cce3cbec2b799b5d9a7aa7954359fae5d67a11f909fb5cfbec5ca93c1/wordler_cli-0.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-08-22 20:46:50",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "k-bartolomeo",
    "github_project": "wordler",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "wordler-cli"
}
        
Elapsed time: 0.30719s