https://github.com/lucasalegre/funk-generator
Earley Algorithm implementation to generate random brazilian funk music.
https://github.com/lucasalegre/funk-generator
earley-algorithm
Last synced: 7 months ago
JSON representation
Earley Algorithm implementation to generate random brazilian funk music.
- Host: GitHub
- URL: https://github.com/lucasalegre/funk-generator
- Owner: LucasAlegre
- License: mit
- Created: 2017-06-01T22:40:12.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-07-27T14:14:22.000Z (over 7 years ago)
- Last Synced: 2025-06-04T06:51:58.975Z (9 months ago)
- Topics: earley-algorithm
- Language: Java
- Homepage:
- Size: 18 MB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# FunkGenerator
This is a third semester university project in which we did a Funk Generator using the Earley algorithm.
A parse implemantation using the Earley algorithm.
It is possible to check if a sentence is part of a given grammar and also to generate a random sentence of any grammar.
## To run the project you have to do:
Run the FunkGenerator.jar
Select a valid grammar on the txt format (FunkGrammar is the default).
Click on "Parse" to parse the string in the textField or click on "Generate Random" to generate a random sentence.
Check "Funk Mode" option to use it to play a random funk music!
*It is important to keep the "batidao.mp3" file in the same folder as the executable
You can also import it as a Java Project!
## How the archive with your grammar has to be sent
```
Terminais # comments are preceded by '#'
[ the ] # terminals section
[ a ]
[ an ]
[ dog ]
[ cat ]
[ apple ]
[ park ]
[ in ]
[ with ]
[ ate ]
[ chased ]
[ liked ]
Variaveis # variables section
[ S ]
[ NP ]
[ VP ]
[ PP ]
[ Det ]
[ N ]
[ P ]
[ V ]
Inicial # the initial variable (it must be only one)
[ S ]
Regras # the rules of the grammar
[ S ] > [ NP ] [ VP ]
[ NP ] > [ Det ] [ N ]
[ NP ] > [ NP ] [ PP ]
[ VP ] > [ V ]
[ VP ] > [ V ] [ NP ]
[ VP ] > [ VP ] [ PP ]
[ PP ] > [ P ] [ NP ]
[ Det ] > [ the ]
[ Det ] > [ a ]
[ Det ] > [ an ]
[ N ] > [ dog ]
[ N ] > [ cat ]
[ N ] > [ apple bla bla ]
[ N ] > [ park ]
[ P ] > [ in ]
[ P ] > [ with ]
[ V ] > [ ate ]
[ V ] > [ chased ]
[ V ] > [ liked ]
```
## Authors:
* **Lucas Alegre** https://github.com/LucasAlegre
* **Catarina Nogueira** https://github.com/cvrnogueira
* **Guilherme Haetinger** https://github.com/gujueno