Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

automaton-tools

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

automaton-tools

some algorithm implementations for automaton and regular expressions

  • 0.1.8
  • PyPI
  • Socket score

Maintainers
1

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.

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc