Formgram is a toolkit for teaching and or learning formal grammars with a focus on exploring the code and experimenting with and on it.
Students can use it to verify their findings in exercise problems and to understand taught algorithms by looking at their implemented form (and experimenting on them to see where those might break).
Teachers can use it to teach algorithms in their implemented form as an alternative to pure mathematical pseudocode.
>>> from formgram.classes.grammar import Grammar >>> grammar_string = \ >>> """ # A simple context free grammar >>> <Sentence> ::= <Subject> " " <Verb> " " <Object> >>> <Subject> ::= <Noun> >>> <Object> ::= <Noun> >>> <Verb> ::= "bites" | "adores" >>> <Noun> ::= "Human" | "Dog" | "Cat" >>> """ >>> grammar = Grammar.from_str(grammar_string) >>> type(grammar) formgram.classes.grammar.ContextFreeGrammar
Installing Formgram and Supported Versions
Formgram is available on PyPI:
$ python -m pip install formgram
Formgram is written and tested on Python 3.8 and should work on any later version.
Features
Formgram is created to enable working with formal grammars in context of a lecture on formal languages. It can:
Determine Chomsky hierarchy level
Determine grammar normal forms
Import/export grammars to string format
Transform to and from corresponding machines
API Reference and User Guide available on gwdg pages
Metadata
Release files for formgram 0.0.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| formgram-0.0.6.tar.gz | 55.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| formgram-0.0.6-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 208.4 kB
Release files / formgram-0.0.6.tar.gz
| Download URL | formgram-0.0.6.tar.gz |
|---|---|
| Size | 55.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a375b3f648da6605154569458114754b9f899df127e17558a989df9ce32c5fe1
|
|
BLAKE2b-256 checksum How to use checksums |
7457c77df12b7cc4860b8b3794ea89ef1d2f201613acea4381fe42ac096aa66a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.7.8
|
Release files / formgram-0.0.6-py3-none-any.whl
| Download URL | formgram-0.0.6-py3-none-any.whl |
|---|---|
| Size | 152.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b34f4cd16dc8c17dc9caf80b9977ed27c22dcdb7e483bdd4a1bb0aa7d665c660
|
|
BLAKE2b-256 checksum How to use checksums |
a6f357d294cfa2d23ead5c717c7d0a67f7e6cd2cf436723d237fd0523f51db27
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.7.8
|