A java library to generate random words. This utilizes the DataMuse API as its word-finding engine.
Import from Maven Central
Using Maven
<dependency>
<groupId>com.github.dhiraj072</groupId>
<artifactId>random-word-generator</artifactId>
<version>1.1.0</version>
</dependency>
Using Gradle
compile 'com.github.dhiraj072:random-word-generator:1.1.0'
Get a random word
// Import the class
import com.github.dhiraj072.randomwordgenerator.RandomWordGenerator;
// Get a random word with a simple static method call
String randomWord = RandomWordGenerator.getRandomWord();
Get a random word skewed towards various parameters supported by DataMuseRequest
import com.github.dhiraj072.randomwordgenerator.datamuse.WordsRequest;
import com.github.dhiraj072.randomwordgenerator.datamuse.DataMuseRequest;
// Get a random word skewed towards topics "Car" and "Road"
WordsRequest customRequest = new DataMuseRequest().topics("Car", "Road");
String randomWord = RandomWordGenerator.getRandomWord(customRequest);
- Gradle - Build tool
- DataMuse API - For getting list of words
- JUnit - Testing Framework
This project is licensed under the MIT License - see the LICENSE.md file for details