Skip to main content

rearrange letters to form new words

Project description

Installation

pip install pnu-anagram

ANAGRAM(6)

NAME

anagram - rearrange letters to form new words

SYNOPSIS

anagram [-d|--dictionary pathname] [-f|--files] [-l|--length numbers] [--debug] [--help|-?] [--version] [--] [letters]

DESCRIPTION

The anagram utility rearranges the given letters to form as many words (anagrams) as possible.

Standard input is read if no letters are provided on the command line.

The -l|--length option can be used to form words of selected size with the letters provided.

The -f|--files option can help you select a dictionary.

OPTIONS

Options Use
-d--dictionary pathname Use this dictionary pathname if you don't want the default dictionary
-f|--files Print possible dictionary files in the DICTPATH
-l|--length numbers Specify anagrams lengths if you want intermediate sizes. numbers is a number or a comma separated list of numbers or dash separated number intervals
--debug Enable debug mode
--help|-? Print usage and a short help message and exit
--version Print version and exit
-- Options processing terminator

ENVIRONMENT

The ANAGRAM_DEBUG environment variable can also be set to any value to enable debug mode.

The DICTPATH environment variable is the search path for the dictionary files. It is a colon-separated list of directories in which anagram looks for a words dictionary file. If not set it will default to /usr/share/dict:/usr/local/share/dict. Under a Posix system, $HOME/.local/share/dict will also be added to the default, while %HOMEPATH%/appdata/roaming/python/share/dict:%HOMEPATH%/appdata/local/programs/python/pythonXX/share/dict will be added under a Windows system.

The ANAGRAM_DICT environment variable provides a way to avoid specifying an alternate directory on each command line.

FILES

/usr/share/dict/words is the default (English) dictionary on a BSD operating system.

Some French dictionaries are also installed as a dependency.

EXIT STATUS

The anagram utility exits 0 on success, and >0 if an error occurs.

EXAMPLES

To solve a Wordscapes (French) level where the available letters are ABCDEFG, I use a command like:

$ export ANAGRAM_DICT=/usr/local/share/dict/dict-fr-Wordscapes
$ anagram -l 3-7 abcdefg

Other dictionaries are also available. For example:

$ export ANAGRAM_DICT=/usr/local/share/dict/dict-fr-ABU-mots_communs.ascii
$ export ANAGRAM_DICT=/usr/local/share/dict/dict-fr-AU-DELA-common-words.ascii

SEE ALSO

grep(1)

STANDARDS

The anagram utility is not a standard UNIX command.

This utility tries to follow the PEP 8 style guide for Python code.

PORTABILITY

Tested OK under Windows.

HISTORY

This utility was made for the PNU project in order to help my wife play Wordscapes when she was stuck on a level.

LICENSE

It is available under the 3-clause BSD license.

AUTHORS

Hubert Tournier

CAVEATS

An English dictionary should be packaged for operating systems that are not providing one.

Searching only for a words link to one of the directories in the DICTPATH is too limitated.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pnu_anagram-1.2.0.tar.gz (10.4 kB view details)

Uploaded Source

Built Distribution

pnu_anagram-1.2.0-py3-none-any.whl (9.2 kB view details)

Uploaded Python 3

File details

Details for the file pnu_anagram-1.2.0.tar.gz.

File metadata

  • Download URL: pnu_anagram-1.2.0.tar.gz
  • Upload date:
  • Size: 10.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.8.12

File hashes

Hashes for pnu_anagram-1.2.0.tar.gz
Algorithm Hash digest
SHA256 6ba010f6bca4d1fa9152a95c071d36cc5b4e30a6f7720d0ba27c674601da71b2
MD5 8133684d2cb32bcb1e0ea54cd22b4c4b
BLAKE2b-256 944087f4713b3f7a57adb9197d6bf8bb2bc573aa171f48d45bcc2c77933cca69

See more details on using hashes here.

File details

Details for the file pnu_anagram-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: pnu_anagram-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 9.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.8.12

File hashes

Hashes for pnu_anagram-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 af42590ba0a8f76044555cc7000718c4c796738b2b3717342d5135b059cb6ed1
MD5 61c8d4ed330f90cd5b8f2c590137a7f8
BLAKE2b-256 ca350a7a5350fc3302aa5dfbc7af3c73c5555054a3437817cbd3997a89227acc

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page