-
Notifications
You must be signed in to change notification settings - Fork 0
/
generator.php
126 lines (88 loc) · 5.57 KB
/
generator.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
<?php
/*
Class: Pokemon Ipsum Generator
Author: Kevin Gong
This class will generator random text with mixed latin and pokemon names! (Only the original 150 cuz that's what's up.) To use, run pokemon_ipsum_generator.php. The parameters can be changed in that file. This is mearly the generator class.
Adapted heavily from Pete Nelson's "Bacon Ipsum Generator", http://baconipsum.com
*/
class PokemonIpsumGenerator {
function GetWords($type) {
$pokemon = array(
'bulbasaur', 'ivysaur', 'venusaur','charmander', 'charmeleon', 'charizard', 'squirtle', 'wartortle', 'blastoise', 'caterpie', 'metapod', 'butterfree', 'weedle', 'kakuna', 'beedrill', 'pidgey', 'pidgeotto', 'pidgeot', 'rattata', 'raticate', 'spearow', 'fearow', 'ekans', 'arbok', 'pikachu', 'raichu', 'sandshrew', 'sandslash', 'nidoran', 'nidorina', 'nidoqueen', 'nidoran', 'nidorino', 'nidoking', 'clefairy', 'clefable', 'vulpix', 'ninetales', 'jigglypuff', 'wigglytuff', 'zubat', 'golbat', 'oddish', 'gloom', 'vileplume', 'paras', 'parasect', 'venonat', 'venomoth', 'diglett', 'dugtrio', 'meowth', 'persian', 'psyduck', 'golduck', 'mankey', 'primeape', 'growlithe', 'arcanine', 'poliwag', 'poliwhirl', 'poliwrath', 'abra', 'kadabra', 'alakazam', 'machop', 'machoke', 'machamp', 'bellsprout', 'weepinbell', 'victreebel', 'tentacool', 'tentacruel', 'geodude', 'graveler', 'golem', 'ponyta', 'rapidash', 'slowpoke', 'slowbro', 'magnemite', 'farfetchd', 'doduo', 'dodrio', 'seel', 'dewgong', 'grimer', 'muk', 'shellder', 'cloyster', 'gastly', 'haunter', 'gengar', 'onix', 'drowzee', 'hypno', 'krabby', 'kingler', 'voltorb', 'electrode', 'exeggcute', 'exeggutor', 'cubone', 'marowak', 'hitmonlee', 'hitmonchan', 'lickitung', 'koffing', 'weezing', 'rhyhorn', 'rhydon', 'chansey', 'tangela', 'kangaskhan', 'horsea', 'seadra', 'goldeen', 'seaking', 'staryu', 'starmie', 'Mr. Mime', 'scyther', 'jynx', 'electabuzz', 'magmar', 'pinsir', 'tauros', 'magikarp', 'gyrados', 'lapras', 'ditto', 'eevee', 'vaporeon', 'jolteon', 'flareon', 'porygon', 'omanyte', 'omastar', 'kabuto', 'kabutops', 'aerodactyl', 'snorlax', 'articuno', 'zapdos', 'moltres', 'dratini', 'dragonair', 'dragonite', 'mewtwo', 'mew'
);
$filler = array(
'consectetur', 'adipisicing', 'elit', 'sed', 'do', 'eiusmod', 'tempor', 'incididunt', 'ut', 'labore', 'et', 'dolore', 'magna', 'aliqua', 'ut', 'enim', 'ad', 'minim', 'veniam', 'quis', 'nostrud', 'exercitation', 'ullamco', 'laboris', 'nisi', 'ut', 'aliquip', 'ex', 'ea', 'commodo', 'consequat', 'duis', 'aute', 'irure', 'dolor', 'in', 'reprehenderit', 'in', 'voluptate', 'velit', 'esse', 'cillum', 'dolore', 'eu', 'fugiat', 'nulla', 'pariatur', 'excepteur', 'sint', 'occaecat', 'cupidatat', 'non', 'proident', 'sunt', 'in', 'culpa', 'qui', 'officia', 'deserunt', 'mollit', 'anim', 'id', 'est', 'laborum', 'consectetur', 'adipisicing', 'elit', 'sed', 'do', 'eiusmod', 'tempor', 'incididunt', 'ut', 'labore', 'et', 'dolore', 'magna', 'aliqua', 'ut', 'enim', 'ad', 'minim', 'veniam', 'quis', 'nostrud', 'exercitation', 'ullamco', 'laboris', 'nisi', 'ut', 'aliquip', 'ex', 'ea', 'commodo', 'consequat', 'duis', 'aute', 'irure', 'dolor', 'in', 'reprehenderit', 'in', 'voluptate', 'velit', 'esse', 'cillum', 'dolore', 'eu', 'fugiat', 'nulla', 'pariatur', 'excepteur', 'sint', 'occaecat', 'cupidatat', 'non', 'proident', 'sunt', 'in', 'culpa', 'qui', 'officia', 'deserunt', 'mollit', 'anim', 'id', 'est', 'laborum', 'consectetur', 'adipisicing', 'elit', 'sed', 'do', 'eiusmod', 'tempor', 'incididunt', 'ut', 'labore', 'et', 'dolore', 'magna', 'aliqua', 'ut', 'enim', 'ad', 'minim', 'veniam', 'quis', 'nostrud', 'exercitation', 'ullamco', 'laboris', 'nisi', 'ut', 'aliquip', 'ex', 'ea', 'commodo', 'consequat', 'duis', 'aute'
);
if ($type == 'mix') {
$words = array_merge($pokemon, $filler);
} elseif ($type == 'filler') {
$words = $filler;
} else {
$words = $pokemon;
}
shuffle($words);
return $words;
}
function Make_a_Sentence($type) {
// A sentence should be bewteen 4 and 15 words.
$sentence = '';
$length = rand(4, 15);
// Add a little more randomness to commas, about 2/3rds of the time
$includeComma = $length >= 7 && rand(0,2) > 0;
$words = $this->GetWords($type);
if (count($words) > 0)
{
// Capitalize the first word.
$words[0] = ucfirst($words[0]);
for ($i = 0; $i < $length; $i++) {
if ($i > 0) {
if ($i >= 3 && $i != $length - 1 && $includeComma) {
if (rand(0,1) == 1) {
$sentence = rtrim($sentence) . ', ';
$includeComma = false;
}
else
$sentence .= ' ';
}
else
$sentence .= ' ';
}
$sentence .= $words[$i];
}
$sentence = rtrim($sentence) . '. ';
}
return $sentence;
}
public function Make_a_Paragraph($type) {
// A paragraph should be bewteen 4 and 7 sentences.
$para = '';
$length = rand(4, 7);
for ($i = 0; $i < $length; $i++)
$para .= $this->Make_a_Sentence($type) . ' ';
return rtrim($para);
}
public function Make_Some_Pokemon_Filler(
$type = 'mix',
$number_of_paragraphs = 5,
$start_with_lorem = true,
$number_of_sentences = 0) {
$paragraphs = array();
if ($number_of_sentences > 0)
$number_of_paragraphs = 1;
$words = '';
for ($i = 0; $i < $number_of_paragraphs; $i++) {
if ($number_of_sentences > 0) {
for ($s = 0; $s < $number_of_sentences; $s++)
$words .= $this->Make_a_Sentence($type);
}
else
$words = $this->Make_a_Paragraph($type);
if ($i == 0 && $start_with_lorem && count($words) > 0) {
$words[0] = strtolower($words[0]);
$words = 'Pikachu ipsum dolor sit amet ' . $words;
}
$paragraphs[] = rtrim($words);
}
return $paragraphs;
}
}