word_generator 0.0.1 word_generator: ^0.0.1 copied to clipboard
A dart package for generating random words.
word_generator #
Utilities for generating random Engligh Words
. As of now only English nouns
are supported. In upcoming version, adjectives and verbs will be added.
Features #
- randomNouns
- randomNoun
- randomSentence
- 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() {
List<String> nouns = WordGenerator().randomNouns(3);
print(nouns);
}
Print single random noun.
import 'package:word_generator/word_generator.dart';
main() {
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() {
List<String> noun = WordGenerator().randomSentence(3);
print(noun);
}
Print count of the syllables in the word
import 'package:word_generator/word_generator.dart';
main() {
int count = WordGenerator().countSyllables('dart');
print(count);
}