nokia / find-abstract-syntax-tree

BSD 3-Clause "New" or "Revised" License
3 stars 1 forks source link

fAST (find Abstract Syntax Tree)

PyPI Build Documentation ReadTheDocs codecov

Overview

find-abstract-syntax-tree is a Python 3 implemention of the fAST algorithm. This algorithm aims at inferring a regular expression from a finite set of positive examples.

The fAST algorithm is described in:

[ICGI'2023] fAST: regular expression inference from positive examples using Abstract Syntax Trees, Maxime Raynal, Marc-Olivier Buob, Georges Quénot.

This module is built on top of:

Quick start

Install the package through PIP:

pip3 install find-abstract-syntax-tree

In your python interpreter, run:

from fast import fast

results = fast(["abc", "abcabc", "abcabcabc"])
for (score, ast) in results:
    print(score, ast.to_infix_regexp_str())

Links

License

This project is licensed under the BSD-3-Clause license.