Skip to content

This Ruby program reads in a list of context free grammar rules and generates all possible sentences defined by the grammar.

Notifications You must be signed in to change notification settings

Squirrel-Lord/Sentence-Generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Sentence-Generator

This Ruby program reads in a list of context free grammar rules and generates all possible sentences defined by the grammar.

It is assumed that the inputted grammar is in the correct format. Nonterminal symbols are on the left and separated from their right-hand-side words by a "->". Right-hand-side words are separated by a space.

After determining the number of grammar rules, the program generates all sentences that are less than or equal to a length requirement.

An example of sample input and output is in sampelInputOutput.

About

This Ruby program reads in a list of context free grammar rules and generates all possible sentences defined by the grammar.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages