Graphs from Context-Free Grammars.
Project description
GrammarGraph
Creating graphs from context-free grammars for fun and profit.
Features
- Creating sub graphs
- Export back to grammars
- Reachability
- Filter abstraction
- Dijkstra's algorithm for shortest paths between nodes
- Checking whether a (sub) graph represents a tree
- Computing k-paths (paths of exactly length k) in grammars and derivation trees, and a k-path coverage measure (see this paper) of derivation trees based on that.
Have a look at our feature demo!
Install
GrammarGraph requires at least Python 3.9.
We recommend to install GrammarGraph in a virtual environment. Example usage (inside project directory):
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
# Run tests
python3 -m pytest -n 16
Author: Dominic Steinhöfel.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
grammar_graph-0.1.2.tar.gz
(46.0 kB
view hashes)
Built Distribution
Close
Hashes for grammar_graph-0.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 92185efe0ce3d8dc14364df9f0fc06ec19eb21ab23badf7f4f3897270599ad86 |
|
MD5 | cd3f87cb2d52ac9e8960940347cbe9a6 |
|
BLAKE2b-256 | 3d68f16c9ae3c1e30e9e29ce64cab09d4117fd7d8a2aa544097798fb0a46078c |