Skip to main content

some algorithm implementations for automaton and regular expressions

Project description

Introduction

This is a simple regular expression program. It implements NFA to DFA, DFA minimization and automaton visualization.

To enable plotting feature, you may need to install graphviz

Usage

from automaton_tools import DFA as MyDFA
myinput = "abc12.+qs{2,}(yui){1,2}?"
dfa = MyDFA.fromRegex(myinput)

# check whether the string matches the pattern from the beginning or not
ismatch = dfa.match("yuiyui")

# plot the transition graph
dfa.drawGraph("dfa")
# it will generate dfa.png file

Known bug

It cannot handle . or \w properly. Because they are considered as a special kind of characters.

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

automaton_tools-0.1.8.tar.gz (14.3 kB view details)

Uploaded Source

Built Distribution

automaton_tools-0.1.8-py3-none-any.whl (18.4 kB view details)

Uploaded Python 3

File details

Details for the file automaton_tools-0.1.8.tar.gz.

File metadata

  • Download URL: automaton_tools-0.1.8.tar.gz
  • Upload date:
  • Size: 14.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.7.0

File hashes

Hashes for automaton_tools-0.1.8.tar.gz
Algorithm Hash digest
SHA256 ac0c7470102f58483370ebefb5e25618e298363466000a82536a299cd6ffd99c
MD5 0848861f53a0aa257e15edc06af605a4
BLAKE2b-256 b16094851eac904cc5d7c70a4c87d3babbddc8ad33fc5b48ac064fa0eb8b5d45

See more details on using hashes here.

File details

Details for the file automaton_tools-0.1.8-py3-none-any.whl.

File metadata

  • Download URL: automaton_tools-0.1.8-py3-none-any.whl
  • Upload date:
  • Size: 18.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.7.0

File hashes

Hashes for automaton_tools-0.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 ab37779fcd31180e866d1b9da9f00a3c9659fd9c86c3ba6ccc229e9640e7d662
MD5 17a547f9948ef219fec8e2352f509b7a
BLAKE2b-256 6c7e989b983a91a80db44e75cfe3f62302389e7a090178ac6b3ac598040945ab

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