Skip to content

A small Python script for generating all possible CFG (Context-free Grammar) words to a particular length.

License

Notifications You must be signed in to change notification settings

tedsomething/genertate-cfg

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

A small Python script for generating all words (and total count of them) that are part of particular CFG (Context-free Grammar).

Getting started

It's really straight forward. Change productions to your specific case. Then, just run it and enter maximum length of a word.

TODO

  • Learn to properly programm in python (or in general)
  • Fix issues

Issues

Warning

It is not a fatal issue, but currently this script creates duplicate productions in the middle. Don't worry only unique words are displayed in the end. However, optimizing this would increase the performance significantly.

Found a bug or better solution? Please report to the issue section.

About

A small Python script for generating all possible CFG (Context-free Grammar) words to a particular length.

Topics

Resources

License

Stars

Watchers

Forks

Languages