Coder Social home page Coder Social logo

minimoore's Introduction

Minimoore

Minimoore is a small implementation of finite state transducers. Currently, only the Moore machine is implemented, but we'll add other features.

Install

This package can be installed as usual with pip:

pip install https://github.com/cipollone/minimoore

Or, we can install a specific version with tested dependencies, by cloning the repository and running:

poetry install --no-dev

From the project directory. Omit the --no-dev option if you're installing for local development.

Then, import minimoore in your project.

Use

A transducer can be instantiated with methods of the specific transducer class, or via a builder. This is the syntax of the builder for Moore machines:

builder = MooreBuilder[int, str]()
(builder.state("s0").init().output("a").to(0, "s1").to(1, "s0"))
(builder.state("s1").output("a").to(0, "any-name").to(1, "s1"))
(builder.state("any-name").output("b").to(0, "s0").to(1, "s0"))

We can now get builder.machine, use it or save it to a Dot file. Moore machines can be minimized, completed (more to add later).

minimoore's People

Contributors

cipollone avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.