Skip to content

Dhiraj072/random-word-generator

Repository files navigation

Random word generator

Build Status Coverage Status

A java library to generate random words. This utilizes the DataMuse API as its word-finding engine.

Usage

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);

Built With

License

This project is licensed under the MIT License - see the LICENSE.md file for details

About

A java library to generate random words

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages