This repository has been archived by the owner on Jun 10, 2022. It is now read-only.
/
align.html
274 lines (257 loc) · 14.3 KB
/
align.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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
{{define "alignPage"}}
<!DOCTYPE html>
<html>
{{template "head"}}
<body>
{{template "header"}}
<div class="o-techdocs-hero">
<h2 class="o-techdocs-hero__title">
A (very) experimental look at recent articles in <a href="http://www.ft.com">FT.com</a>,
<br>at first, exploring the visual impact of aligning the search results in novel ways,
<br>but then, looking for syllables and rhymes and poetry.
</h2>
</div>
<div class="o-techdocs-container">
<div class="o-techdocs-layout">
<!-- Main content (outer div for layout, inner for formatting) -->
<div class="o-techdocs-main">
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/font-awesome/4.2.0/css/font-awesome.css"></link>
<div class="o-techdocs-content">
<p>
The code for all this sits at <a href="https://github.com/railsagainstignorance/alignment">github.com/railsagainstignorance/alignment</a>.
<br>It makes use of the enormous and enormously useful phoneme dataset, <a href="http://www.speech.cs.cmu.edu/cgi-bin/cmudict">CMU Pronouncing Dictionary</a>.
<br>The haiku-detection is written up in a <a href="http://labs.ft.com/2016/07/finding-hidden-haiku/">FT Labs blog post</a>.
</p>
</p>
<h2>align on matching phrase</h2>
<p>
The search text used to identify the articles (via keyword search) is used to align the results.
</p>
<form action="/align" method="GET">
<table>
<tr>
<td><input type="text" name="text" value="has its own"></td>
<td>source:</td>
<td><input type="radio" name="source" value="any" checked> any
<br><input type="radio" name="source" value="title-only"> title-only</td>
<td><input type="submit" value="search and align on matching phrase"></td>
</tr>
</table>
</form>
<h2>align an article's sentences matching meter</h2>
<p>
You identify an article (with a UUID from the url, by hand, sorry) and specify a meter.
<br>If any of the sentences within that article body contain text conforming to that meter, they are aligned accordingly.
<br>Meter, you ask? See <a href="http://examples.yourdictionary.com/examples-of-iambic-pentameter.html">the internet</a> for some examples.
<br>You specify the meter as a sequence of 0s and 1s, where 1 is the emphasised beat.
<br>You can anchor the meter to the ^start or end$ of the text, or leave it free to match anywhere.
</p>
<form action="/ontology" method="GET">
<table>
<tr>
<td style="text-align:right;">
<input type="hidden" name="ontology" value="id">
<br>uuid <input type="text" name="value" value="b57fee24-cb3c-11e5-be0b-b7ece4e953a0">
<br>meter <input type="text" name="meter" value="01010101">
</td>
<td>
<br><input type="submit" value="get article and align on matching sentences">
</td>
</tr>
</table>
</form>
<h2>find author's recent articles' phrases matching the meter</h2>
<p>
You identify an author and specify a meter.
<br>If any of the sentences within recent articles by that author contain text conforming to that meter, they are aligned accordingly.
<br>Meter, you ask? See <a href="http://examples.yourdictionary.com/examples-of-iambic-pentameter.html">the internet</a> for some examples.
<br>You specify the meter as a sequence of 0s and 1s, where 1 is the emphasised beat.
<br>You can anchor the meter to the ^start or end$ of the text, or leave it free to match anywhere.
</p>
<form action="/ontology" method="GET">
<table>
<tr>
<td style="text-align:right;">
<input type="hidden" name="ontology" value="authors">
<br>author <input type="text" name="value" value="Lucy Kellaway">
<br>meter <input type="text" name="meter" value="0101010101">
</td>
<td>max <input type="text" name="max" value="10">
<br><input type="submit" value="search for articles and align on matching meter"> (NB: there will be a bit of a delay)</td>
</tr>
</table>
</form>
<h2>find author's recent articles' phrases matching the haiku meter, 5-7-5</h2>
<p>
You identify an author.
<br>If any of the sentences within recent articles by that author contain text conforming to the haiku meter, 5-7-5, they are displayed.
<br>Meter, you ask? See <a href="http://examples.yourdictionary.com/examples-of-iambic-pentameter.html">the internet</a> for some examples.
<br>You specify the meter as a sequence of 0s and 1s, where 1 is the emphasised beat.
<br>You can anchor the meter to the ^start or end$ of the text, or leave it free to match anywhere.
</p>
<form action="/ontology" method="GET">
<table>
<tr>
<td style="text-align:right;">
<input type="hidden" name="ontology" value="authors">
<br>author <input type="text" name="value" value="Lucy Kellaway">
<input type="hidden" name="meter" value="..... ....... .....">
</td>
<td>max <input type="text" name="max" value="10">
<br><input type="submit" value="search for articles and align on matching meter"> (NB: there will be a bit of a delay)</td>
</tr>
</table>
</form>
<h2>find ontology's recent articles' phrases matching the meter</h2>
<p>
You identify an ontology and value, and a meter.
<br>If any of the sentences within the relevant recent articles contain text conforming to that meter, they are aligned accordingly.
<br>Meter, you ask? See <a href="http://examples.yourdictionary.com/examples-of-iambic-pentameter.html">the internet</a> for some examples.
<br>You specify the meter as a sequence of 0s and 1s, where 1 is the emphasised beat.
<br>You can anchor the meter to the ^start or end$ of the text, or leave it free to match anywhere.
</p>
<form action="/ontology" method="GET">
<table>
<tr>
<td style="text-align:right;">
ontology <input type="text" name="ontology" value="brand">
<br>value <input type="text" name="value" value="Lunch with the FT">
<br>meter <input type="text" name="meter" value="0101010101">
</td>
<td>max <input type="text" name="max" value="10">
<br><input type="submit" value="search for articles and align on matching meter"> (NB: there will be a bit of a delay)</td>
</tr>
</table>
</form>
<h2>find ontology's recent articles' phrases matching the haiku meter, 5-7-5</h2>
<p>
You specify an ontology and value.
<br>If any of the sentences within the relevant recent articles contain text conforming to the haiku meter, 5-7-5, they are displayed.
<br>Meter, you ask? See <a href="http://examples.yourdictionary.com/examples-of-iambic-pentameter.html">the internet</a> for some examples.
<br>You specify the meter as a sequence of 0s and 1s, where 1 is the emphasised beat.
<br>You can anchor the meter to the ^start or end$ of the text, or leave it free to match anywhere.
</p>
<form action="/ontology" method="GET">
<table>
<tr>
<td style="text-align:right;">
ontology <input type="text" name="ontology" value="brand">
<br>value <input type="text" name="value" value="Lunch with the FT">
<br><input type="hidden" name="meter" value="..... ....... .....">
</td>
<td>max <input type="text" name="max" value="10">
<br><input type="submit" value="search for articles and align on matching meter"> (NB: there will be a bit of a delay)</td>
</tr>
</table>
</form>
<h2>find page's current articles' phrases matching the haiku meter, 5-7-5</h2>
<p>
You specify a sitepage.
<br>If any of the sentences within the relevant articles contain text conforming to the haiku meter, 5-7-5, they are displayed.
<br>Meter, you ask? See <a href="http://examples.yourdictionary.com/examples-of-iambic-pentameter.html">the internet</a> for some examples.
<br>You specify the meter as a sequence of 0s and 1s, where 1 is the emphasised beat.
<br>You can anchor the meter to the ^start or end$ of the text, or leave it free to match anywhere.
</p>
<form action="/ontology" method="GET">
<table>
<tr>
<td style="text-align:right;">
<input type="hidden" name="ontology" value="pages">
page <input type="text" name="value" value="http://www.ft.com/home/uk">
<br><input type="hidden" name="meter" value="..... ....... .....">
</td>
<td>
<input type="hidden" name="max" value="20">
<input type="submit" value="search for the page's articles and align on matching meter"> (NB: there will be a bit of a delay)
</td>
</tr>
</table>
</form>
<h2>for articles before the date, find phrases matching the haiku meter, 5-7-5</h2>
<p>
You identify an date.
<br>If any of the sentences within recent articles before that date contain text conforming to the haiku meter, 5-7-5, they are displayed.
<br>Meter, you ask? See <a href="http://examples.yourdictionary.com/examples-of-iambic-pentameter.html">the internet</a> for some examples.
<br>You specify the meter as a sequence of 0s and 1s, where 1 is the emphasised beat.
<br>You can anchor the meter to the ^start or end$ of the text, or leave it free to match anywhere.
</p>
<form action="/ontology" method="GET">
<table>
<tr>
<td style="text-align:right;">
<input type="hidden" name="ontology" value="before">
<br>before <input type="text" name="value" value="2014-03-18T19:00:00Z">
<input type="hidden" name="meter" value="..... ....... .....">
</td>
<td>max <input type="text" name="max" value="10">
<br><input type="submit" value="search for articles and align on matching meter"> (NB: there will be a bit of a delay)</td>
</tr>
</table>
</form>
<h2>explore phrases matching meter</h2>
<p>
You specify a phrase and a meter.
<br>Details extracted from the phrase and the meter are displayed, mostly for debugging purposes,
<br>but it is interesting to see how the words are fragmented into phonemes and syllables.
<br>If any parts of the phrase contain text conforming to that meter, they are aligned accordingly.
<br>Meter, you ask? See <a href="http://examples.yourdictionary.com/examples-of-iambic-pentameter.html">the internet</a> for some examples.
<br>You specify the meter as a sequence of 0s and 1s, where 1 is the emphasised beat.
<br>You can anchor the meter to the ^start or end$ of the text, or leave it free to match anywhere.
</p>
<p>
Perhaps you want to see why a particular phrase does not get matched by the meter? Most likely first, consider
<ol>
<li>Its a bug - in which case, feel free to let me know</li>
<li>The phonemes are based on American pronounciation, and they do speak funny. So, sorry, but, shrug.</li>
<li>The phonemes' emphasis points are perhaps too rigid to allow sufficient slack for the word to be spoken in a poetic context. Again, sorry, shrug.</li>
</ol>
</p>
<form action="/detail" method="GET">
<table>
<tr>
<td style="text-align:right;">
phrase <input type="text" name="phrase" value="All my nosuchword elephants are really very perceptive">
<br>meter <input type="text" name="meter" value="10">
</td>
<td><input type="submit" value="find meter within the phrase"></td>
</tr>
</table>
</form>
<h2>Caveats</h2>
<p>
<ul>
<li>It has very little error handling</li>
<li>It can not work for an excitingly wide variety of reasons.
<li>Perhaps the main reason for flakiness is that this is MyFirstGoProgram.</li>
</ul>
... so choose wisely.
</p>
<hr>
<h2>extras</h2>
<ul>
<li><a href="/pullquotes/rss">/pullquotes/rss</a></li>
<li><a href="/pullquotes/json">/pullquotes/json</a></li>
<li><a href="/firstft/rss">/firstft/rss</a></li>
</ul>
<hr>
<h2>Simply interesting</h2>
<ul>
<li><a href="http://www.ft.com/recruitment/workplace-haiku">Workplace Haiku at the FT</a></li>
<li><a href="http://haiku.nytimes.com/about">Haikus at the New York Times</a></li>
<li><a href="https://en.wikipedia.org/wiki/Computational_humor">Computational Humour</a></li>
<li><a href="https://en.wikipedia.org/wiki/The_Ode_Less_Travelled">The Ode Less Travelled</a> by Stephen Fry</li>
<li><a href="https://en.wikipedia.org/wiki/List_of_English_words_without_rhymes">English words without rhymes</a></li>
<li><a href="http://ed.ted.com/lessons/why-shakespeare-loved-iambic-pentameter-david-t-freeman-and-gregory-taylor">Why Shakespere loved</a> <a href="https://www.youtube.com/watch?v=v0aAWuUX5jU">iambic pentameter</a></li>
<li><a href="https://xkcd.com/79/">XKCD does iambic pentameter</a></li>
</ul>
<h3>assorted imagery</h3>
<a href="https://www.flickr.com/photos/60584010@N00/4512300401"><img src="https://farm3.staticflickr.com/2024/4512300401_b0d2b8ca52_o_d.jpg"></a>
<a href="https://www.flickr.com/photos/artbystevejohnson/4621636807"><img src="https://farm5.staticflickr.com/4033/4621636807_2e1540fef7_o_d.jpg"></a>
<a href="https://www.flickr.com/photos/dentonpotter/11590533916"><img src="https://c2.staticflickr.com/4/3731/11590533916_d05e1a1d8e_b.jpg"></a>
</div>
</div>
</div>
</div>
</body>
</html>
{{end}}