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.7.tar.gz
(14.1 kB
view details)
Built Distribution
File details
Details for the file automaton_tools-0.1.7.tar.gz
.
File metadata
- Download URL: automaton_tools-0.1.7.tar.gz
- Upload date:
- Size: 14.1 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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 51bb91270f3ede43f8538bfceae47aeedbfe4813b63679792b8168c3302956ec |
|
MD5 | 80e352c694861a09cb86e5fb80f45875 |
|
BLAKE2b-256 | 080856a40286b9c3360540f37525118b89b9bd1aca20ccdcfe6e87c13df45231 |
File details
Details for the file automaton_tools-0.1.7-py3-none-any.whl
.
File metadata
- Download URL: automaton_tools-0.1.7-py3-none-any.whl
- Upload date:
- Size: 18.2 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
Algorithm | Hash digest | |
---|---|---|
SHA256 | fe97663953f285dd81e4522f1fc1f340b9fe74bba48f7a967c534a7b3901a4f2 |
|
MD5 | 19ab0eab9c4c858c8134cb4b2e6dc748 |
|
BLAKE2b-256 | a927cf7780cb7634c2fe467a43d237adf2482ee054a220f63aa44f38383a3bee |