You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 19, 2023. It is now read-only.
`anagram-generator` is a minimal python package that lets you generate multi-word anagrams from any corpus. This package is written in pure python and has no dependencies. See `anagram-generator/writeup/writeup.pdf` to learn how it works (**tries** and clever sorting of partially generated anagrams), or read the source code at `anagram-generator/anagram-generator.py`. Example corpuses are in `anagram-generator/corpuses`.
### Installation
Installation is easy using `pip`.
```sh
$ pip install anagramgen
```
### Example
```python
from anagramgen import anagramgen
with open('anagramgen/corpuses/top-5k.txt', 'r') as file:
corpus = [line.strip() for line in file.readlines()]
gen = anagramgen.AnagramGenerator(corpus)
print("\n".join([" ".join(anagram) for anagram in gen.generate("wonderland")]))