-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.html
117 lines (101 loc) · 4.03 KB
/
index.html
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
<!DOCTYPE html>
<html>
<head>
<meta charset = "utf-8">
<title>Markov Word Generator</title>
<meta name = "description" content = "Generate random words with a Markov chain.">
<link rel="icon" type="image/png" href="favicon.png">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Bootstrap and custom CSS. -->
<link rel = "stylesheet" href = "https://maxcdn.bootstrapcdn.com/bootswatch/3.3.5/lumen/bootstrap.min.css">
<link rel = "stylesheet" href = "word-generator.css">
<!-- jQuery and Bootstrap JS. -->
<script src = "http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script src = "http://netdna.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
<!-- CoffeeScript. -->
<script src = "coffee-script.js"></script>
<script type = "text/coffeescript" src = "markov.coffee"></script>
<script type = "text/coffeescript" src = "word-generator.coffee"></script>
</head>
<body>
<div class = "container">
<div class = "page-header">
<h1>
Markov Word Generator
<small>for producing partly-random, partly-legible words</small>
</h1>
</div>
</div>
<div class = "jumbotron">
<div class = "container">
<h1>
<small>Your word is:</small>
<span id = "word"></span>
</h1>
<button id = "button" class = "btn btn-lg btn-primary">
Generate another!
</button>
</div>
</div>
<div class = "container">
<div class = "col-xs-12">
<p class = "lead">This word generator uses a <a href = "http://en.wikipedia.org/wiki/Markov_chain">Markov chain</a> to create words that look weird and random but that are still largely pronounceable. View the GitHub project <a href = "http://github.com/SyntaxColoring/Markov-Word-Generator">here</a> or play with the settings below.</p>
</div>
<div class = "col-sm-9">
<h2>Edit Corpus</h2>
<p>The <i>corpus</i> is a sample of real words that's used as a starting point to generate new words. Generated words will be somewhat similar to the original ones from the corpus.</p>
<div class = "form-horizontal">
<div class = "form-group">
<label class = "control-label col-sm-3">Use a preset:</label>
<!-- Corpus preset dropdown button. -->
<div class = "btn-group col-sm-1">
<button id = "corpusButton" class = "btn btn-default dropdown-toggle" data-toggle = "dropdown">
<span id = "corpusName">Loading...</span>
<span class = "caret"></span>
</button>
<ul id = "corpora" class = "dropdown-menu">
</ul>
</div>
</div>
<div class = "form-group">
<label for = "corpusInput" class = "control-label col-sm-3">Or input your own:</label>
<!-- Corpus raw text input area. -->
<div class = "col-sm-9">
<textarea id = "corpusInput" class = "form-control col-xs-2" rows = "5" spellcheck = "false"></textarea>
</div>
<div class = "col-sm-9 col-sm-offset-3">
<div class = "help-block">
Use spaces or line breaks to separate words. Capitalization, punctuation, numbers and special characters are ignored.
</div>
</div>
</div>
</div>
</div>
<div class = "col-sm-3">
<h2>Tweak Settings</h2>
<div>
<div class="form-group">
<label for = "order" class = "control-label">Markov order</label>
<div class = "input-group">
<span class = "input-group-addon"><i>n</i> =</span>
<input type = "number" min = "0" max = "4" value = "2" id="order" class = "form-control">
</div>
<div class = "help-block">
Low values produce more random words, while high values produce more legible words.
</div>
</div>
<div class="form-group">
<label for="maxLength" class = "control-label">Maximum length</label>
<div class = "input-group">
<input type = "number" min = "1" max = "11" value = "8" id="maxLength" class = "form-control">
<span class = "input-group-addon">letters</span>
</div>
<div class = "help-block">
Words will be truncated to this length.
</div>
</div>
</div>
</div>
</div>
</body>
</html>