Skip to main content

Python wrapper around cGADDAG

Project description

GADDAG

GADDAG is a Python wrapper around cGADDAG.

A GADDAG data structure provides rapid word lookups for prefixes, suffixes and substrings, making it ideal for use in applications such as move generation in word games such as Scrabble.

Basic usage:

>>> import gaddag
>>> words = ["foo", "bar", "foobar", "baz"]
>>> gdg = gaddag.GADDAG(words)
>>> "foo" in gdg
True
>>> "bor" in gdg
False
>>> gdg.contains("ba")
['bar', 'foobar', 'baz']

GADDAG currently only supports the ASCII alphabet.

Installation

From PyPI:

pip install gaddag

Documentation

Documentaion is available in the docs directory, or rendered at http://gaddag.readthedocs.io.

License

Licensed under the MIT License, see LICENSE.

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

GADDAG-1.0.1.tar.gz (339.1 kB view hashes)

Uploaded Source

Built Distribution

GADDAG-1.0.1-cp38-cp38-macosx_10_15_x86_64.whl (10.8 kB view hashes)

Uploaded CPython 3.8 macOS 10.15+ x86-64

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