random-words 1.0.4 → 1.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (173) hide show
  1. checksums.yaml +4 -4
  2. data/.rspec_status +148 -39
  3. data/.rubocop.yml +1 -0
  4. data/CHANGELOG.md +42 -0
  5. data/Gemfile.lock +4 -1
  6. data/README.md +153 -4
  7. data/bin/randw +195 -49
  8. data/lib/random-words/array.rb +51 -0
  9. data/lib/random-words/config.rb +248 -0
  10. data/lib/random-words/generator.rb +239 -93
  11. data/lib/random-words/hash.rb +16 -0
  12. data/lib/random-words/html2markdown.rb +205 -0
  13. data/lib/random-words/lorem-markdown.rb +398 -0
  14. data/lib/random-words/number-to-word.rb +137 -0
  15. data/lib/random-words/source.rb +105 -0
  16. data/lib/random-words/string.rb +221 -47
  17. data/lib/random-words/table-cleanup.rb +210 -0
  18. data/lib/random-words/version.rb +1 -1
  19. data/lib/random-words/words/1984/adjectives.txt +103 -0
  20. data/lib/random-words/words/1984/adverbs.txt +92 -0
  21. data/lib/random-words/words/1984/articles-plural.txt +10 -0
  22. data/lib/random-words/words/1984/articles-singular.txt +10 -0
  23. data/lib/random-words/words/1984/clauses.txt +79 -0
  24. data/lib/random-words/words/1984/config.yml +4 -0
  25. data/lib/random-words/words/1984/conjunctions-coordinating.txt +20 -0
  26. data/lib/random-words/words/1984/conjunctions-subordinate.txt +29 -0
  27. data/lib/random-words/words/1984/names.txt +74 -0
  28. data/lib/random-words/words/1984/nouns-plural.txt +89 -0
  29. data/lib/random-words/words/1984/nouns-singular.txt +74 -0
  30. data/lib/random-words/words/1984/numbers.yml +5 -0
  31. data/lib/random-words/words/1984/prepositions.txt +89 -0
  32. data/lib/random-words/words/1984/terminators.txt +16 -0
  33. data/lib/random-words/words/1984/verbs-passive.txt +83 -0
  34. data/lib/random-words/words/1984/verbs-plural.txt +91 -0
  35. data/lib/random-words/words/1984/verbs-singular.txt +110 -0
  36. data/lib/random-words/words/alice/adjectives.txt +80 -0
  37. data/lib/random-words/words/alice/adverbs.txt +87 -0
  38. data/lib/random-words/words/alice/articles-plural.txt +10 -0
  39. data/lib/random-words/words/alice/articles-singular.txt +10 -0
  40. data/lib/random-words/words/alice/clauses.txt +81 -0
  41. data/lib/random-words/words/alice/config.yml +4 -0
  42. data/lib/random-words/words/alice/conjunctions-coordinating.txt +20 -0
  43. data/lib/random-words/words/alice/conjunctions-subordinate.txt +29 -0
  44. data/lib/random-words/words/alice/names.txt +74 -0
  45. data/lib/random-words/words/alice/nouns-plural.txt +95 -0
  46. data/lib/random-words/words/alice/nouns-singular.txt +82 -0
  47. data/lib/random-words/words/alice/numbers.yml +5 -0
  48. data/lib/random-words/words/alice/prepositions.txt +45 -0
  49. data/lib/random-words/words/alice/terminators.txt +16 -0
  50. data/lib/random-words/words/alice/verbs-passive.txt +495 -0
  51. data/lib/random-words/words/alice/verbs-plural.txt +115 -0
  52. data/lib/random-words/words/alice/verbs-singular.txt +97 -0
  53. data/lib/random-words/words/bacon/clauses.txt +592 -592
  54. data/lib/random-words/words/bacon/config.yml +4 -0
  55. data/lib/random-words/words/bacon/conjunctions-coordinating.txt +20 -0
  56. data/lib/random-words/words/bacon/names.txt +74 -0
  57. data/lib/random-words/words/bacon/numbers.yml +5 -0
  58. data/lib/random-words/words/bacon/prepositions.txt +45 -0
  59. data/lib/random-words/words/bacon/terminators.txt +16 -0
  60. data/lib/random-words/words/corporate/config.yml +4 -0
  61. data/lib/random-words/words/corporate/conjunctions-coordinating.txt +20 -0
  62. data/lib/random-words/words/corporate/names.txt +74 -0
  63. data/lib/random-words/words/corporate/numbers.yml +5 -0
  64. data/lib/random-words/words/corporate/prepositions.txt +45 -0
  65. data/lib/random-words/words/corporate/terminators.txt +16 -0
  66. data/lib/random-words/words/doctor/adjectives.txt +92 -0
  67. data/lib/random-words/words/doctor/adverbs.txt +92 -0
  68. data/lib/random-words/words/doctor/articles-plural.txt +10 -0
  69. data/lib/random-words/words/doctor/articles-singular.txt +10 -0
  70. data/lib/random-words/words/doctor/clauses.txt +83 -0
  71. data/lib/random-words/words/doctor/config.yml +10 -0
  72. data/lib/random-words/words/doctor/conjunctions-coordinating.txt +20 -0
  73. data/lib/random-words/words/doctor/conjunctions-subordinate.txt +29 -0
  74. data/lib/random-words/words/doctor/names.txt +74 -0
  75. data/lib/random-words/words/doctor/nouns-plural.txt +84 -0
  76. data/lib/random-words/words/doctor/nouns-singular.txt +84 -0
  77. data/lib/random-words/words/doctor/numbers.yml +5 -0
  78. data/lib/random-words/words/doctor/prepositions.txt +45 -0
  79. data/lib/random-words/words/doctor/terminators.txt +16 -0
  80. data/lib/random-words/words/doctor/verbs-passive.txt +83 -0
  81. data/lib/random-words/words/doctor/verbs-plural.txt +88 -0
  82. data/lib/random-words/words/doctor/verbs-singular.txt +83 -0
  83. data/lib/random-words/words/english/clauses.txt +592 -592
  84. data/lib/random-words/words/english/config.yml +4 -0
  85. data/lib/random-words/words/english/conjunctions-coordinating.txt +20 -0
  86. data/lib/random-words/words/english/names.txt +74 -0
  87. data/lib/random-words/words/english/numbers.yml +5 -0
  88. data/lib/random-words/words/english/prepositions.txt +45 -0
  89. data/lib/random-words/words/english/terminators.txt +16 -0
  90. data/lib/random-words/words/english/verbs-plural.txt +1 -0
  91. data/lib/random-words/words/english/verbs-singular.txt +1 -0
  92. data/lib/random-words/words/foulmouth/adjectives.txt +89 -0
  93. data/lib/random-words/words/foulmouth/adverbs.txt +97 -0
  94. data/lib/random-words/words/foulmouth/articles-plural.txt +10 -0
  95. data/lib/random-words/words/foulmouth/articles-singular.txt +10 -0
  96. data/lib/random-words/words/foulmouth/clauses.txt +74 -0
  97. data/lib/random-words/words/foulmouth/config.yml +4 -0
  98. data/lib/random-words/words/foulmouth/conjunctions-coordinating.txt +20 -0
  99. data/lib/random-words/words/foulmouth/conjunctions-subordinate.txt +29 -0
  100. data/lib/random-words/words/foulmouth/names.txt +74 -0
  101. data/lib/random-words/words/foulmouth/nouns-plural.txt +96 -0
  102. data/lib/random-words/words/foulmouth/nouns-singular.txt +99 -0
  103. data/lib/random-words/words/foulmouth/numbers.yml +5 -0
  104. data/lib/random-words/words/foulmouth/prepositions.txt +35 -0
  105. data/lib/random-words/words/foulmouth/terminators.txt +16 -0
  106. data/lib/random-words/words/foulmouth/verbs-passive.txt +143 -0
  107. data/lib/random-words/words/foulmouth/verbs-plural.txt +91 -0
  108. data/lib/random-words/words/foulmouth/verbs-singular.txt +104 -0
  109. data/lib/random-words/words/hipster/adjectives.txt +100 -0
  110. data/lib/random-words/words/hipster/adverbs.txt +89 -0
  111. data/lib/random-words/words/hipster/articles-plural.txt +10 -0
  112. data/lib/random-words/words/hipster/articles-singular.txt +10 -0
  113. data/lib/random-words/words/hipster/clauses.txt +180 -0
  114. data/lib/random-words/words/hipster/config.yml +4 -0
  115. data/lib/random-words/words/hipster/conjunctions-coordinating.txt +20 -0
  116. data/lib/random-words/words/hipster/conjunctions-subordinate.txt +29 -0
  117. data/lib/random-words/words/hipster/names.txt +74 -0
  118. data/lib/random-words/words/hipster/nouns-plural.txt +96 -0
  119. data/lib/random-words/words/hipster/nouns-singular.txt +100 -0
  120. data/lib/random-words/words/hipster/numbers.yml +5 -0
  121. data/lib/random-words/words/hipster/prepositions.txt +45 -0
  122. data/lib/random-words/words/hipster/terminators.txt +16 -0
  123. data/lib/random-words/words/hipster/verbs-passive.txt +88 -0
  124. data/lib/random-words/words/hipster/verbs-plural.txt +106 -0
  125. data/lib/random-words/words/hipster/verbs-singular.txt +114 -0
  126. data/lib/random-words/words/latin/config.yml +4 -0
  127. data/lib/random-words/words/latin/conjunctions-coordinating.txt +15 -0
  128. data/lib/random-words/words/latin/names.txt +74 -0
  129. data/lib/random-words/words/latin/numbers.yml +5 -0
  130. data/lib/random-words/words/latin/prepositions.txt +18 -0
  131. data/lib/random-words/words/latin/terminators.txt +16 -0
  132. data/lib/random-words/words/spanish/adjectives.txt +81 -0
  133. data/lib/random-words/words/spanish/adverbs.txt +87 -0
  134. data/lib/random-words/words/spanish/articles-plural.txt +4 -0
  135. data/lib/random-words/words/spanish/articles-singular.txt +4 -0
  136. data/lib/random-words/words/spanish/clauses.txt +74 -0
  137. data/lib/random-words/words/spanish/config.yml +4 -0
  138. data/lib/random-words/words/spanish/conjunctions-coordinating.txt +8 -0
  139. data/lib/random-words/words/spanish/conjunctions-subordinate.txt +16 -0
  140. data/lib/random-words/words/spanish/names.txt +74 -0
  141. data/lib/random-words/words/spanish/nouns-plural.txt +92 -0
  142. data/lib/random-words/words/spanish/nouns-singular.txt +125 -0
  143. data/lib/random-words/words/spanish/numbers.yml +5 -0
  144. data/lib/random-words/words/spanish/prepositions.txt +31 -0
  145. data/lib/random-words/words/spanish/terminators.txt +17 -0
  146. data/lib/random-words/words/spanish/verbs-passive.txt +495 -0
  147. data/lib/random-words/words/spanish/verbs-plural.txt +326 -0
  148. data/lib/random-words/words/spanish/verbs-singular.txt +351 -0
  149. data/lib/random-words/words/veggie/adjectives.txt +111 -0
  150. data/lib/random-words/words/veggie/adverbs.txt +81 -0
  151. data/lib/random-words/words/veggie/articles-plural.txt +10 -0
  152. data/lib/random-words/words/veggie/articles-singular.txt +10 -0
  153. data/lib/random-words/words/veggie/clauses.txt +57 -0
  154. data/lib/random-words/words/veggie/config.yml +4 -0
  155. data/lib/random-words/words/veggie/conjunctions-coordinating.txt +20 -0
  156. data/lib/random-words/words/veggie/conjunctions-subordinate.txt +29 -0
  157. data/lib/random-words/words/veggie/names.txt +74 -0
  158. data/lib/random-words/words/veggie/nouns-plural.txt +78 -0
  159. data/lib/random-words/words/veggie/nouns-singular.txt +105 -0
  160. data/lib/random-words/words/veggie/numbers.yml +5 -0
  161. data/lib/random-words/words/veggie/prepositions.txt +45 -0
  162. data/lib/random-words/words/veggie/terminators.txt +16 -0
  163. data/lib/random-words/words/veggie/verbs-passive.txt +56 -0
  164. data/lib/random-words/words/veggie/verbs-plural.txt +79 -0
  165. data/lib/random-words/words/veggie/verbs-singular.txt +79 -0
  166. data/lib/random-words.rb +28 -0
  167. data/random-words.gemspec +3 -1
  168. data/src/_README.md +153 -4
  169. metadata +168 -7
  170. data/lib/random-words/words/bacon/numbers.txt +0 -21
  171. data/lib/random-words/words/corporate/numbers.txt +0 -21
  172. data/lib/random-words/words/english/numbers.txt +0 -21
  173. data/lib/random-words/words/latin/numbers.txt +0 -21
@@ -0,0 +1,79 @@
1
+ arrange
2
+ bake
3
+ balance
4
+ blend
5
+ buy
6
+ catalog
7
+ challenge
8
+ choose
9
+ chop
10
+ clean
11
+ collect
12
+ combine
13
+ complete
14
+ consume
15
+ cook
16
+ cut
17
+ dice
18
+ dig
19
+ distribute
20
+ dress
21
+ eat
22
+ enhance
23
+ enjoy
24
+ export
25
+ fertilize
26
+ finish
27
+ flavor
28
+ freeze
29
+ frost
30
+ fry
31
+ glaze
32
+ grill
33
+ grow
34
+ harvest
35
+ import
36
+ innovate
37
+ inspect
38
+ marinate
39
+ marvel
40
+ mash
41
+ melt
42
+ offer
43
+ organize
44
+ pair
45
+ pick
46
+ plant
47
+ plate
48
+ prepare
49
+ preserve
50
+ process
51
+ purchase
52
+ puree
53
+ recommend
54
+ refrigerate
55
+ roast
56
+ sample
57
+ sauté
58
+ savor
59
+ season
60
+ select
61
+ separate
62
+ serve
63
+ share
64
+ shred
65
+ slice
66
+ specialize
67
+ sprinkle
68
+ steam
69
+ stir
70
+ store
71
+ substitute
72
+ taste
73
+ toss
74
+ transform
75
+ transport
76
+ wash
77
+ whip
78
+ whisk
79
+ zest
@@ -0,0 +1,79 @@
1
+ arranges
2
+ bakes
3
+ balances
4
+ blends
5
+ buys
6
+ catalogs
7
+ challenges
8
+ chooses
9
+ chops
10
+ cleans
11
+ collects
12
+ combines
13
+ completes
14
+ consumes
15
+ cooks
16
+ cuts
17
+ dices
18
+ digs
19
+ distributes
20
+ dresses
21
+ eats
22
+ enhances
23
+ enjoys
24
+ exports
25
+ fertilizes
26
+ finishes
27
+ flavors
28
+ freezes
29
+ frosts
30
+ fry
31
+ glazes
32
+ grills
33
+ grows
34
+ harvests
35
+ imports
36
+ innovates
37
+ inspects
38
+ marinates
39
+ marvels
40
+ mashes
41
+ melts
42
+ offers
43
+ organizes
44
+ pairs
45
+ picks
46
+ plants
47
+ plates
48
+ prepares
49
+ preserves
50
+ processes
51
+ purchases
52
+ purees
53
+ recommends
54
+ refrigerates
55
+ roasts
56
+ samples
57
+ sautés
58
+ savors
59
+ seasons
60
+ selects
61
+ separates
62
+ serves
63
+ shares
64
+ shreds
65
+ slices
66
+ specializes
67
+ sprinkles
68
+ steams
69
+ stirs
70
+ stores
71
+ substitutes
72
+ tastes
73
+ tosses
74
+ transforms
75
+ transports
76
+ washes
77
+ whips
78
+ whisks
79
+ zests
data/lib/random-words.rb CHANGED
@@ -1,6 +1,34 @@
1
1
  #!/usr/bin/env ruby
2
2
  # frozen_string_literal: true
3
3
 
4
+ require 'fileutils'
5
+ require 'yaml'
6
+
4
7
  require_relative 'random-words/version'
5
8
  require_relative 'random-words/string'
9
+ require_relative 'random-words/hash'
10
+ require_relative 'random-words/array'
11
+ require_relative 'random-words/source'
12
+ require_relative 'random-words/config'
6
13
  require_relative 'random-words/generator'
14
+ require_relative 'random-words/number-to-word'
15
+ require_relative 'random-words/lorem-markdown.rb'
16
+ require_relative 'random-words/html2markdown.rb'
17
+
18
+ # Main module for RandomWords
19
+ module RandomWords
20
+ # Main class for RandomWords
21
+ class << self
22
+ # @!visibility private
23
+ attr_accessor :testing, :tested
24
+
25
+ # @!visibility private
26
+ # Initialize the RandomWords module
27
+ def initialize!(testing = false)
28
+ @testing ||= testing
29
+ @tested ||= []
30
+ end
31
+ end
32
+
33
+ initialize!
34
+ end
data/random-words.gemspec CHANGED
@@ -14,7 +14,7 @@ Gem::Specification.new do |spec|
14
14
  spec.license = 'MIT'
15
15
  spec.required_ruby_version = '>= 2.6.0'
16
16
 
17
- spec.metadata['rubygems_mfa_required'] = false
17
+ spec.metadata['rubygems_mfa_required'] = 'true'
18
18
  spec.metadata['homepage_uri'] = spec.homepage
19
19
  spec.metadata['source_code_uri'] = spec.homepage
20
20
  spec.metadata['bug_tracker_uri'] = "#{spec.metadata['source_code_uri']}/issues"
@@ -33,4 +33,6 @@ Gem::Specification.new do |spec|
33
33
  end
34
34
 
35
35
  spec.metadata['rubygems_mfa_required'] = 'true'
36
+
37
+ spec.add_dependency 'nokogiri', '~> 1.12'
36
38
  end
data/src/_README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # RandomWords
2
2
  <!--README-->
3
3
 
4
- [![RubyGems.org](https://img.shields.io/gem/v/snibbets)](https://rubygems.org/gems/snibbets)
4
+ [![RubyGems.org](https://img.shields.io/gem/v/random-words)](https://rubygems.org/gems/random-words)
5
5
 
6
6
  A random text (Lorem Ipsum) generator.
7
7
 
@@ -9,7 +9,11 @@ A random text (Lorem Ipsum) generator.
9
9
 
10
10
  gem install random-words
11
11
 
12
- Depending on your setup, you may need `gem install --user-install random-words`, or in worst case scenario, `sudo gem install random-words`. You can also use `brew gem install random-words` if you use [Homebrew](https://brew.sh).
12
+ Depending on your setup, you may need
13
+ `gem install --user-install random-words`, or in
14
+ worst case scenario, `sudo gem install random-words`.
15
+ You can also use `brew gem install random-words` if
16
+ you use [Homebrew](https://brew.sh).
13
17
 
14
18
  ### CLI
15
19
 
@@ -17,24 +21,169 @@ The gem installs a binary `randw`. It can generate random characters, sentences,
17
21
 
18
22
  ```console
19
23
  Usage: randw [options]
20
- Options:
24
+ OPTIONS:
21
25
  -S, --source [SOURCE] Specify the source language (default: latin)
22
26
  -l [short|medium|long|very_long],
23
27
  --length Specify the length of the sentence
24
28
  --graf-length [NUMBER] Specify the number of sentences in a paragraph
25
29
  -s, --sentences [NUMBER] Generate random sentences
30
+ GENERATORS:
26
31
  -p, --paragraphs [NUMBER] Generate random paragraphs
27
32
  -w, --words [NUMBER] Generate random words
28
33
  -c, --characters [NUMBER] Generate random characters
34
+ -m, --markdown SETTINGS Generate random markdown text, comma separated string like "latin,10,all"
29
35
  --password Generate a random password
36
+ PASSWORD OPTIONS:
30
37
  --separator [CHAR] Specify the separator character for the password
31
- -n, --no-whitespace Specify whether to remove whitespace in generated text (characters only)
38
+ --[no-]extended Specify whether to use extended punctuation in generated text
39
+ -n, --[no-]whitespace Specify whether to remove whitespace in generated text (characters only)
40
+ DICTIONARIES:
41
+ --list-dictionaries List available dictionaries
42
+ --create-dictionary [NAME] Create a new dictionary
43
+ OTHER OPTIONS:
32
44
  -d, --debug Enable debug mode, displays sentence/word/character counts
33
45
  -h, --help Display this help message
34
46
  -v, --version Display the version
35
47
  -t, --test Run the full debug test
36
48
  ```
37
49
 
50
+ #### Generating Markdown text
51
+
52
+ The `--markdown` flag takes a SETTINGS argument. This is a
53
+ comma- or slash-separated string that determines the
54
+ elements to include.
55
+
56
+ First, the source language (defaults to latin), then the
57
+ length of paragraphs and tables: e.g. `english/medium`. You
58
+ can add any digits to determine how many paragraps are
59
+ generated (default 5), e.g. `corporate/medium/10`.
60
+
61
+ Then you can add individual elements, or use `/all` to
62
+ trigger all elements. The elements available are:
63
+
64
+ | trigger | element |
65
+ | :------ | :------------------------ |
66
+ | dec | add em and strong |
67
+ | link | add links |
68
+ | ul | add unordered lists |
69
+ | ol | add ordered lists |
70
+ | dl | add definition lists |
71
+ | bq | add block quotes |
72
+ | code | add code spans and blocks |
73
+ | mark | add ==highlights== |
74
+ | headers | add headlines |
75
+ | image | add images |
76
+ | table | add tables |
77
+
78
+ The number of elements inserted depends on the length you specify.
79
+
80
+ Example commands:
81
+
82
+ $ randw -m "latin/10/ol/dl/table"
83
+ $ randw -m "english/5/all"
84
+
85
+
86
+ #### Creating A New Dictionary
87
+
88
+ You can add your own sources for generating your random
89
+ text. A dictionary is a directory containing several text
90
+ files, one for each part of speech that RandomWords uses.
91
+ All of the parts must exist. The directory name is the same
92
+ as the name of the dictionary.
93
+
94
+ User dictionaries must be stored in `~/.config/random-words/words/[NAME]`.
95
+
96
+ The easiest way to generate a new language is to use the CLI:
97
+
98
+ ```console
99
+ randw --create-dictionary [NAME]
100
+ ```
101
+
102
+ Once this command is run, a new directory in
103
+ `~/.config/random-words/words` will be created containing
104
+ all of the necessary files with English defaults. Simply
105
+ edit these files, and then you'll be able to call the
106
+ language by its name (or triggers defined in the config, see
107
+ below). If a language of the same name exists, missing files
108
+ will be filled in, but existing files will not be
109
+ overwritten.
110
+
111
+ The necessary files are:
112
+
113
+ ```console
114
+ adjectives.txt
115
+ adverbs.txt
116
+ articles-plural.txt
117
+ articles-singular.txt
118
+ clauses.txt
119
+ config.yml
120
+ conjunctions-coordinating.txt
121
+ conjunctions-subordinate.txt
122
+ nouns-plural.txt
123
+ nouns-singular.txt
124
+ numbers.txt
125
+ prepositions.txt
126
+ terminators.txt
127
+ verbs-passive.txt
128
+ verbs-plural.txt
129
+ verbs-singular.txt
130
+ ```
131
+
132
+ The `terminators.txt` file contains pairs of punctuation,
133
+ separated by commas, one per line. If a sentene terminator
134
+ doesn't have opening punctuation, start the line with a
135
+ comma. More than one character can be used in either side of
136
+ the pair. For example, to create a double quoted sentence
137
+ with a period inside the closing quote, you would use:
138
+
139
+ ",."
140
+
141
+ A blank line (or any line not containing a comma) will
142
+ separate regular punctuation from extended punctuation. In
143
+ the default file, `.`, `?`, and `!` are considered regular
144
+ punctuation, and parenthesis and quotes are considered
145
+ extended punctuation. Extended punctuation is off by
146
+ default, but in the CLI can be enabled with `--extended`,
147
+ and using the library you can include
148
+ `use_extended_punctuation: true` in the options when
149
+ initializing, or use `@rw.use_extended_punctuation = true`
150
+ to set it after initializing.
151
+
152
+ Repeating words or terminators more than once in the config
153
+ files increases their likelihood of being used. In the
154
+ default terminator.txt files, the period, question mark, and
155
+ exclamation point are repeated multiple times to make them
156
+ the most likely to be used.
157
+
158
+
159
+ ##### Language Configuration
160
+
161
+ The `config.yml` file in a language directory is a simple
162
+ YAML configuration. It contains the keys:
163
+
164
+ ```yaml
165
+ ---
166
+ name: english
167
+ description: English words
168
+ triggers: [english]
169
+ ```
170
+
171
+ A default configuration file will be created when running `--create-dictionary` with the CLI.
172
+
173
+ - `name`: The name of the dictionary
174
+
175
+ This should be the same as the directory name in most cases
176
+ - `description`: Just used for display when running `--list-dictionaries`
177
+ - `triggers`: An array of triggers that can be used to trigger the language.
178
+
179
+ For example, the `bacon` language has the triggers `[bacon, meat, carnivore]`, so you can use `randw -S meat` on the command line (or with the library).
180
+
181
+ > RandomWords loosely uses English rules for sentence construction, so non-English languages will likely generate even more nonsensical strings.
182
+
183
+ If you create a fun dictionary, please let me know (or make a PR) and I'll gladly include (most) new dictionaries in the main distribution.
184
+
185
+ > The easiest way to get words is with AI. A ChatGPT prompt like "give me 100 plural nouns related to the medical profession, in plain text, one per line, sorted alphabetically" will get you a good list of words you can then just paste into `nouns-plural.txt` in your dictionary.
186
+
38
187
  ### Library
39
188
 
40
189
  ```ruby
metadata CHANGED
@@ -1,14 +1,28 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: random-words
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
4
+ version: 1.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brett Terpstra
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-04-09 00:00:00.000000000 Z
11
- dependencies: []
10
+ date: 2025-04-14 00:00:00.000000000 Z
11
+ dependencies:
12
+ - !ruby/object:Gem::Dependency
13
+ name: nokogiri
14
+ requirement: !ruby/object:Gem::Requirement
15
+ requirements:
16
+ - - "~>"
17
+ - !ruby/object:Gem::Version
18
+ version: '1.12'
19
+ type: :runtime
20
+ prerelease: false
21
+ version_requirements: !ruby/object:Gem::Requirement
22
+ requirements:
23
+ - - "~>"
24
+ - !ruby/object:Gem::Version
25
+ version: '1.12'
12
26
  description: Generate random text (lorem ipsum) from a variety of sources. Can be
13
27
  used to generate random words, sentences, or paragraphs.
14
28
  email: me@brettterpstra.com
@@ -29,18 +43,65 @@ files:
29
43
  - Rakefile
30
44
  - bin/randw
31
45
  - lib/random-words.rb
46
+ - lib/random-words/array.rb
47
+ - lib/random-words/config.rb
32
48
  - lib/random-words/generator.rb
49
+ - lib/random-words/hash.rb
50
+ - lib/random-words/html2markdown.rb
51
+ - lib/random-words/lorem-markdown.rb
52
+ - lib/random-words/number-to-word.rb
53
+ - lib/random-words/source.rb
33
54
  - lib/random-words/string.rb
55
+ - lib/random-words/table-cleanup.rb
34
56
  - lib/random-words/version.rb
57
+ - lib/random-words/words/1984/adjectives.txt
58
+ - lib/random-words/words/1984/adverbs.txt
59
+ - lib/random-words/words/1984/articles-plural.txt
60
+ - lib/random-words/words/1984/articles-singular.txt
61
+ - lib/random-words/words/1984/clauses.txt
62
+ - lib/random-words/words/1984/config.yml
63
+ - lib/random-words/words/1984/conjunctions-coordinating.txt
64
+ - lib/random-words/words/1984/conjunctions-subordinate.txt
65
+ - lib/random-words/words/1984/names.txt
66
+ - lib/random-words/words/1984/nouns-plural.txt
67
+ - lib/random-words/words/1984/nouns-singular.txt
68
+ - lib/random-words/words/1984/numbers.yml
69
+ - lib/random-words/words/1984/prepositions.txt
70
+ - lib/random-words/words/1984/terminators.txt
71
+ - lib/random-words/words/1984/verbs-passive.txt
72
+ - lib/random-words/words/1984/verbs-plural.txt
73
+ - lib/random-words/words/1984/verbs-singular.txt
74
+ - lib/random-words/words/alice/adjectives.txt
75
+ - lib/random-words/words/alice/adverbs.txt
76
+ - lib/random-words/words/alice/articles-plural.txt
77
+ - lib/random-words/words/alice/articles-singular.txt
78
+ - lib/random-words/words/alice/clauses.txt
79
+ - lib/random-words/words/alice/config.yml
80
+ - lib/random-words/words/alice/conjunctions-coordinating.txt
81
+ - lib/random-words/words/alice/conjunctions-subordinate.txt
82
+ - lib/random-words/words/alice/names.txt
83
+ - lib/random-words/words/alice/nouns-plural.txt
84
+ - lib/random-words/words/alice/nouns-singular.txt
85
+ - lib/random-words/words/alice/numbers.yml
86
+ - lib/random-words/words/alice/prepositions.txt
87
+ - lib/random-words/words/alice/terminators.txt
88
+ - lib/random-words/words/alice/verbs-passive.txt
89
+ - lib/random-words/words/alice/verbs-plural.txt
90
+ - lib/random-words/words/alice/verbs-singular.txt
35
91
  - lib/random-words/words/bacon/adjectives.txt
36
92
  - lib/random-words/words/bacon/adverbs.txt
37
93
  - lib/random-words/words/bacon/articles-plural.txt
38
94
  - lib/random-words/words/bacon/articles-singular.txt
39
95
  - lib/random-words/words/bacon/clauses.txt
96
+ - lib/random-words/words/bacon/config.yml
97
+ - lib/random-words/words/bacon/conjunctions-coordinating.txt
40
98
  - lib/random-words/words/bacon/conjunctions-subordinate.txt
99
+ - lib/random-words/words/bacon/names.txt
41
100
  - lib/random-words/words/bacon/nouns-plural.txt
42
101
  - lib/random-words/words/bacon/nouns-singular.txt
43
- - lib/random-words/words/bacon/numbers.txt
102
+ - lib/random-words/words/bacon/numbers.yml
103
+ - lib/random-words/words/bacon/prepositions.txt
104
+ - lib/random-words/words/bacon/terminators.txt
44
105
  - lib/random-words/words/bacon/verbs-passive.txt
45
106
  - lib/random-words/words/bacon/verbs-plural.txt
46
107
  - lib/random-words/words/bacon/verbs-singular.txt
@@ -49,37 +110,137 @@ files:
49
110
  - lib/random-words/words/corporate/articles-plural.txt
50
111
  - lib/random-words/words/corporate/articles-singular.txt
51
112
  - lib/random-words/words/corporate/clauses.txt
113
+ - lib/random-words/words/corporate/config.yml
114
+ - lib/random-words/words/corporate/conjunctions-coordinating.txt
52
115
  - lib/random-words/words/corporate/conjunctions-subordinate.txt
116
+ - lib/random-words/words/corporate/names.txt
53
117
  - lib/random-words/words/corporate/nouns-plural.txt
54
118
  - lib/random-words/words/corporate/nouns-singular.txt
55
- - lib/random-words/words/corporate/numbers.txt
119
+ - lib/random-words/words/corporate/numbers.yml
120
+ - lib/random-words/words/corporate/prepositions.txt
121
+ - lib/random-words/words/corporate/terminators.txt
56
122
  - lib/random-words/words/corporate/verbs-passive.txt
57
123
  - lib/random-words/words/corporate/verbs-plural.txt
58
124
  - lib/random-words/words/corporate/verbs-singular.txt
125
+ - lib/random-words/words/doctor/adjectives.txt
126
+ - lib/random-words/words/doctor/adverbs.txt
127
+ - lib/random-words/words/doctor/articles-plural.txt
128
+ - lib/random-words/words/doctor/articles-singular.txt
129
+ - lib/random-words/words/doctor/clauses.txt
130
+ - lib/random-words/words/doctor/config.yml
131
+ - lib/random-words/words/doctor/conjunctions-coordinating.txt
132
+ - lib/random-words/words/doctor/conjunctions-subordinate.txt
133
+ - lib/random-words/words/doctor/names.txt
134
+ - lib/random-words/words/doctor/nouns-plural.txt
135
+ - lib/random-words/words/doctor/nouns-singular.txt
136
+ - lib/random-words/words/doctor/numbers.yml
137
+ - lib/random-words/words/doctor/prepositions.txt
138
+ - lib/random-words/words/doctor/terminators.txt
139
+ - lib/random-words/words/doctor/verbs-passive.txt
140
+ - lib/random-words/words/doctor/verbs-plural.txt
141
+ - lib/random-words/words/doctor/verbs-singular.txt
59
142
  - lib/random-words/words/english/adjectives.txt
60
143
  - lib/random-words/words/english/adverbs.txt
61
144
  - lib/random-words/words/english/articles-plural.txt
62
145
  - lib/random-words/words/english/articles-singular.txt
63
146
  - lib/random-words/words/english/clauses.txt
147
+ - lib/random-words/words/english/config.yml
148
+ - lib/random-words/words/english/conjunctions-coordinating.txt
64
149
  - lib/random-words/words/english/conjunctions-subordinate.txt
150
+ - lib/random-words/words/english/names.txt
65
151
  - lib/random-words/words/english/nouns-plural.txt
66
152
  - lib/random-words/words/english/nouns-singular.txt
67
- - lib/random-words/words/english/numbers.txt
153
+ - lib/random-words/words/english/numbers.yml
154
+ - lib/random-words/words/english/prepositions.txt
155
+ - lib/random-words/words/english/terminators.txt
68
156
  - lib/random-words/words/english/verbs-passive.txt
69
157
  - lib/random-words/words/english/verbs-plural.txt
70
158
  - lib/random-words/words/english/verbs-singular.txt
159
+ - lib/random-words/words/foulmouth/adjectives.txt
160
+ - lib/random-words/words/foulmouth/adverbs.txt
161
+ - lib/random-words/words/foulmouth/articles-plural.txt
162
+ - lib/random-words/words/foulmouth/articles-singular.txt
163
+ - lib/random-words/words/foulmouth/clauses.txt
164
+ - lib/random-words/words/foulmouth/config.yml
165
+ - lib/random-words/words/foulmouth/conjunctions-coordinating.txt
166
+ - lib/random-words/words/foulmouth/conjunctions-subordinate.txt
167
+ - lib/random-words/words/foulmouth/names.txt
168
+ - lib/random-words/words/foulmouth/nouns-plural.txt
169
+ - lib/random-words/words/foulmouth/nouns-singular.txt
170
+ - lib/random-words/words/foulmouth/numbers.yml
171
+ - lib/random-words/words/foulmouth/prepositions.txt
172
+ - lib/random-words/words/foulmouth/terminators.txt
173
+ - lib/random-words/words/foulmouth/verbs-passive.txt
174
+ - lib/random-words/words/foulmouth/verbs-plural.txt
175
+ - lib/random-words/words/foulmouth/verbs-singular.txt
176
+ - lib/random-words/words/hipster/adjectives.txt
177
+ - lib/random-words/words/hipster/adverbs.txt
178
+ - lib/random-words/words/hipster/articles-plural.txt
179
+ - lib/random-words/words/hipster/articles-singular.txt
180
+ - lib/random-words/words/hipster/clauses.txt
181
+ - lib/random-words/words/hipster/config.yml
182
+ - lib/random-words/words/hipster/conjunctions-coordinating.txt
183
+ - lib/random-words/words/hipster/conjunctions-subordinate.txt
184
+ - lib/random-words/words/hipster/names.txt
185
+ - lib/random-words/words/hipster/nouns-plural.txt
186
+ - lib/random-words/words/hipster/nouns-singular.txt
187
+ - lib/random-words/words/hipster/numbers.yml
188
+ - lib/random-words/words/hipster/prepositions.txt
189
+ - lib/random-words/words/hipster/terminators.txt
190
+ - lib/random-words/words/hipster/verbs-passive.txt
191
+ - lib/random-words/words/hipster/verbs-plural.txt
192
+ - lib/random-words/words/hipster/verbs-singular.txt
71
193
  - lib/random-words/words/latin/adjectives.txt
72
194
  - lib/random-words/words/latin/adverbs.txt
73
195
  - lib/random-words/words/latin/articles-plural.txt
74
196
  - lib/random-words/words/latin/articles-singular.txt
75
197
  - lib/random-words/words/latin/clauses.txt
198
+ - lib/random-words/words/latin/config.yml
199
+ - lib/random-words/words/latin/conjunctions-coordinating.txt
76
200
  - lib/random-words/words/latin/conjunctions-subordinate.txt
201
+ - lib/random-words/words/latin/names.txt
77
202
  - lib/random-words/words/latin/nouns-plural.txt
78
203
  - lib/random-words/words/latin/nouns-singular.txt
79
- - lib/random-words/words/latin/numbers.txt
204
+ - lib/random-words/words/latin/numbers.yml
205
+ - lib/random-words/words/latin/prepositions.txt
206
+ - lib/random-words/words/latin/terminators.txt
80
207
  - lib/random-words/words/latin/verbs-passive.txt
81
208
  - lib/random-words/words/latin/verbs-plural.txt
82
209
  - lib/random-words/words/latin/verbs-singular.txt
210
+ - lib/random-words/words/spanish/adjectives.txt
211
+ - lib/random-words/words/spanish/adverbs.txt
212
+ - lib/random-words/words/spanish/articles-plural.txt
213
+ - lib/random-words/words/spanish/articles-singular.txt
214
+ - lib/random-words/words/spanish/clauses.txt
215
+ - lib/random-words/words/spanish/config.yml
216
+ - lib/random-words/words/spanish/conjunctions-coordinating.txt
217
+ - lib/random-words/words/spanish/conjunctions-subordinate.txt
218
+ - lib/random-words/words/spanish/names.txt
219
+ - lib/random-words/words/spanish/nouns-plural.txt
220
+ - lib/random-words/words/spanish/nouns-singular.txt
221
+ - lib/random-words/words/spanish/numbers.yml
222
+ - lib/random-words/words/spanish/prepositions.txt
223
+ - lib/random-words/words/spanish/terminators.txt
224
+ - lib/random-words/words/spanish/verbs-passive.txt
225
+ - lib/random-words/words/spanish/verbs-plural.txt
226
+ - lib/random-words/words/spanish/verbs-singular.txt
227
+ - lib/random-words/words/veggie/adjectives.txt
228
+ - lib/random-words/words/veggie/adverbs.txt
229
+ - lib/random-words/words/veggie/articles-plural.txt
230
+ - lib/random-words/words/veggie/articles-singular.txt
231
+ - lib/random-words/words/veggie/clauses.txt
232
+ - lib/random-words/words/veggie/config.yml
233
+ - lib/random-words/words/veggie/conjunctions-coordinating.txt
234
+ - lib/random-words/words/veggie/conjunctions-subordinate.txt
235
+ - lib/random-words/words/veggie/names.txt
236
+ - lib/random-words/words/veggie/nouns-plural.txt
237
+ - lib/random-words/words/veggie/nouns-singular.txt
238
+ - lib/random-words/words/veggie/numbers.yml
239
+ - lib/random-words/words/veggie/prepositions.txt
240
+ - lib/random-words/words/veggie/terminators.txt
241
+ - lib/random-words/words/veggie/verbs-passive.txt
242
+ - lib/random-words/words/veggie/verbs-plural.txt
243
+ - lib/random-words/words/veggie/verbs-singular.txt
83
244
  - random-words.gemspec
84
245
  - src/_README.md
85
246
  homepage: https://github.com/ttscoff/random-words
@@ -1,21 +0,0 @@
1
- zero
2
- one
3
- two
4
- three
5
- four
6
- five
7
- six
8
- seven
9
- eight
10
- nine
11
- ten
12
- eleven
13
- twelve
14
- thirteen
15
- fourteen
16
- fifteen
17
- sixteen
18
- seventeen
19
- eighteen
20
- nineteen
21
- twenty
@@ -1,21 +0,0 @@
1
- zero
2
- one
3
- two
4
- three
5
- four
6
- five
7
- six
8
- seven
9
- eight
10
- nine
11
- ten
12
- eleven
13
- twelve
14
- thirteen
15
- fourteen
16
- fifteen
17
- sixteen
18
- seventeen
19
- eighteen
20
- nineteen
21
- twenty