word_generator 0.3.2 word_generator: ^0.3.2 copied to clipboard
A dart based util package for generating random nouns, verbs and names. This package helps you to generate random words for your project without any hassle.
word_generator #
Utilities for generating random Engligh Words
. Generate random nouns
,verbs
and names
.
🚀 Features #
nouns #
- randomNouns
- randomNoun
- randomSentence
verbs #
- randomVerbs
- randomVerb
names #
- randomNames
- nandomName
common util #
- countSyllables
🎮 Usage #
Print 3 random nouns. Parameter is optional, if no param is provided then 2 noun will be generated.
import 'package:word_generator/word_generator.dart';
main() {
final wordGenerator = WordGenerator();
List<String> nouns = wordGenerator.randomNouns(3);
print(nouns);
}
Print single random noun.
import 'package:word_generator/word_generator.dart';
main() {
final wordGenerator = WordGenerator();
String noun = wordGenerator.randomNoun();
print(noun);
}
Print sentence with the random nouns. Parameter is optional, if no param is provided then 2 noun will be generated.
import 'package:word_generator/word_generator.dart';
main() {
final wordGenerator = WordGenerator();
List<String> noun = wordGenerator.randomSentence(3);
print(noun);
}
Print count of the syllables in the word
import 'package:word_generator/word_generator.dart';
main() {
final wordGenerator = WordGenerator();
int count = wordGenerator.countSyllables('dart');
print(count);
}
Print 3 random verbs. Parameter is optional, if no param is provided then 2 noun will be generated.
import 'package:word_generator/word_generator.dart';
main() {
final wordGenerator = WordGenerator();
List<String> verbs = wordGenerator.randomVerbs(3);
print(verbs);
}
Print single random verb.
import 'package:word_generator/word_generator.dart';
main() {
final wordGenerator = WordGenerator();
String verb = wordGenerator.randomVerb();
print(verb);
}
Print 3 random names. Parameter is optional, if no param is provided then 2 noun will be generated.
import 'package:word_generator/word_generator.dart';
main() {
final wordGenerator = WordGenerator();
List<String> names = wordGenerator.randomNames(3);
print(names);
}
Print single random name.
import 'package:word_generator/word_generator.dart';
main() {
final wordGenerator = WordGenerator();
String name = wordGenerator.randomName();
print(name);
}
😅 Issue #
If you face any issues, please raise an issue.