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.5.tar.gz
(14.1 kB
view hashes)
Built Distribution
Close
Hashes for automaton_tools-0.1.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ccd4b0961c7381b5b81f0572cb4a2ef7f0e0e08fdb1dc63a9942fe5b8a6867db |
|
MD5 | 2e4e2dd5d8211824e60ec69165c6245f |
|
BLAKE2b-256 | 94f8078125a60095ea492580cf60c8284dab70d9f53100e820ac936ec7907e47 |