Skip to content
This repository has been archived by the owner on Feb 21, 2021. It is now read-only.

powellcj12/sentence-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SentenceGenerator

Introduction

Randomly generate a sentence based on a supplied grammar. The user can "talk" to the computer but it the sentence generated is not sensitive to this context.

Usage

make
./chat

Execution

The generator first asks for a grammar file from which it will generate sentences. It utilizes a context-free grammar, and the grammar.txt file provides an example. The format is as follows:

NonTerminal Symbol0 Symbol1 ... SymbolN .

Note that each production rule must be ended with the '.' character.

Output

The grammar function derive() returns a random sentence based on the initial symbols passed as the sole argument. This symbol must be a non-terminal in the grammar.

About

Generates random sentence based on a supplied grammar.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages