Skip to content

Klemek/FrenchSentencesGenerator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Scc Count Badge Language grade: Java Total alerts

French Sentences Generator (by Klemek)

A Java port of Romain Valeri's generator from Javascript;

Current version v1.0

Examples :

En ville, un artisan dispensé de sport part.
Yasser Arafat admet bloquer sur un cheval...
Je parviendrai à me masser au pôle nord.
Elles tablent sur des inspirations.
Un penseur végétera-t-il pour la science ?
Le gondolier table sur la direction à Disneyland.

How to use :

SentenceGenerator gen = new SentenceGenerator();
gen.generate(); //returns a String sentence

Parameters :

SentenceGenerator gen = new SentenceGenerator();

gen.setSubject("Une voiture__F"); //set subject (end with "__F" to set feminine gender)
gen.keepStructure(true); //set to lock a structure for next sentences
gen.setQuestionMode(QuestionMode.FORBIDDEN); //choose to allow or not questions in the sentence

gen.generate();

Download

Maven

You can use this project as a maven dependency with this :

<repositories>
    ...
    <repository>
        <id>fr.klemek</id>
        <url>https://github.com/klemek/mvn-repo/raw/master</url>
    </repository>
</repositories>
...
<dependencies>
    ...
    <dependency>
        <groupId>fr.klemek</groupId>
        <artifactId>french-sentences-gen</artifactId>
        <version>1.0</version>
    </dependency>
</dependencies>