-
Notifications
You must be signed in to change notification settings - Fork 11
Command Line Interface
Wonderwords has a command line interface that comes from installing it through PyPI where you can easily generate random words and sentences from the terminal.
usage: wonderwords [-h] [-n] [-v] [-a] [-min MIN] [-max MAX] [-amount AMOUNT]
[-sep SEP] [-s] [-sw SW] [-stype STYPE]
mode
To user wonderwords you first specify the positional argument mode
. There are three options:
- rw: to generate random words
- rl: to generate a list of random words
- rs: to generate a random sentence
For example:
$ wonderwords rw
unarmed
Here are optional arguments you can add to enhance the generation of random words, lists and sentences:
If none of the optional arguments for this mode are specified, using the mode will generate a random word from a list of nouns, verbs and adjectives. The arguments below can enhance the generation of the word. For example:
Generate a noun or verb with a minimum length of four chatacters and a maximum length of ten characters.
$ wonderwords rw -n -v -min 4 -max 10
variation
When none of the part of speech options below are chosen, all parts of speech will be generated. If one or more of these part of speech arguments are used, only words of the specified parts of speech will be generated.
- -n: Include nouns.
- -v: Include verbs.
- -a: Include adjectives.
Here you can specify the minimum length of the random word, maximum length or both.
-
-min MIN: The minimum length of the word. Ex:
-min 4
will give a word at least four letters long. -
-max MAX: The maximum length of the word. Ex:
-max 7
will give a word with at most 7 letters
Specify what the word starts with:
-
-sw SW: Type one letter that the word starts with. Ex:
-sw a
will generate a word that starts witha
rl mode generates a python list of random words. However you can customize the word types, lengths and separators between the words in the list. For example:
Generate a list of 5 adjectives separated by ,
and with spaces after each ,
:
$ wonderwords rl -amount 5 -a -sep , -s
fearless, yellow, slow, belligerent, shy
-
-amount AMOUNT: The amount of words you want in the random list. Ex:
-amount 5
will return a list of 5 words.
Specify the separators in-between words in the list:
-
-sep SEP: What you want in-between words in the list. Ex:
-sep " & "
will separate all words in the list with&
. Keep in mind the spaces or else the & will be squished between the words like&so. -
-s: add a space after the separator. Ex:
wonderwords rl -amount 2 -sep "," -s
will return this:stomach, red
. Notice the space in between the,
andr
.
When none of the part of speech options below are chosen, all parts of speech will be generated. If one or more of these part of speech arguments are used, only words of the specified parts of speech will be generated.
- -n: Include nouns.
- -v: Include verbs.
- -a: Include adjectives.
Here you can specify the minimum length of the random word, maximum length or both.
-
-min MIN: The minimum length of the word. Ex:
-min 4
will give a word at least four letters long. -
-max MAX: The maximum length of the word. Ex:
-max 7
will give a word with at most 7 letters
There is only one optional argument for rs mode (more to come!) that specifies the type of sentence:
-
-stype STYPE:
-stype
will specify the type of sentence to generate. Look below for options.
Options for -stype:
-
bb: Will generate a bare bone sentence in the form of:
The [noun] [verb]s
-
ss: Will generate a simple sentence in the form of
The [noun] [verb]s [direct object]
-
bba: Will generate a bare bone sentence with an adjective in the form of
The [adjective] [noun] [verb]s
-
s: Will generate a sentence in the form of
The [adjective] [noun] [verb]s [direct object]
⚠️ This documentation will no longer be updated, as Wonderwords version 2 is now out. You can find the new documentation at https://wonderwords.readthedocs.io
⚠️ This documentation will no longer be updated, as Wonderwords version 2 is now out. You can find the new documentation at https://wonderwords.readthedocs.io