word_generator 0.0.2 word_generator: ^0.0.2 copied to clipboard
A dart util package for generating random nouns and verbs. 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
and verbs
🚀 Features #
- randomNouns
- randomNoun
- randomSentence
- countSyllables
- randomVerbs
- randomVerb
🎮 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() {
WordGenerator wordGenerator = WordGenerator();
List<String> nouns = wordGenerator.randomNouns(3);
print(nouns);
}
Print single random noun.
import 'package:word_generator/word_generator.dart';
main() {
WordGenerator 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() {
WordGenerator 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() {
WordGenerator 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() {
WordGenerator wordGenerator = WordGenerator();
List<String> verbs = wordGenerator.randomVerbs(3);
print(verbs);
}
Print single random verb.
import 'package:word_generator/word_generator.dart';
main() {
WordGenerator wordGenerator = WordGenerator();
String verb = wordGenerator.randomVerb();
print(verb);
}
😅 Issue #
If you face any issues, please raise an issue.