Skip to content

Commit

Permalink
Fleshed out the tests a little more for the weekly summaries.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason LaPorte committed Jul 2, 2013
1 parent eb356c9 commit 11a63eb
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 14 deletions.
32 changes: 18 additions & 14 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<html>
<head>
<title>Dark Sky Multilingual Text Summaries</title>
<meta charset="utf-8"/>

<style type="text/css">
body {
Expand Down Expand Up @@ -299,27 +300,33 @@ <h1>Dark Sky Multilingual Text Summaries</h1>
(clause
(for-week
(condition no-precipitation))
(...)))</pre></td>
<td class="en">No precipitation throughout the week, ...</td>
(temperatures-peaking
(quantity fahrenheit 85)
(day tomorrow))))</pre></td>
<td class="en">No precipitation throughout the week, temperatures peaking at 85°F tomorrow.</td>
</tr>

<tr>
<td class="input"><pre>(sentence
(clause
(over-weekend
(condition mixed-precipitation))
(...)))</pre></td>
<td class="en">Mixed precipitation over the weekend, ...</td>
(temperatures-rising
(quantity celsius 32)
(day thursday))))</pre></td>
<td class="en">Mixed precipitation over the weekend, temperatures rising to 32°C on Thursday.</td>
</tr>

<tr>
<td class="input"><pre>(sentence
(clause
(on
(condition medium-rain)
(day sunday))
(...)))</pre></td>
<td class="en">Rain on Sunday, ...</td>
(day today))
(temperatures-valleying
(quantity fahrenheit 15)
(day friday))))</pre></td>
<td class="en">Rain today, temperatures bottoming out at 15°F on Friday.</td>
</tr>

<tr>
Expand All @@ -330,8 +337,10 @@ <h1>Dark Sky Multilingual Text Summaries</h1>
(and
(day monday)
(day tuesday)))
(...)))</pre></td>
<td class="en">Flurries on Monday and Tuesday, ...</td>
(temperatures-falling
(quantity celsius 0)
(day sunday))))</pre></td>
<td class="en">Flurries on Monday and Tuesday, temperatures falling to 0°C on Sunday.</td>
</tr>

<tr>
Expand All @@ -346,11 +355,6 @@ <h1>Dark Sky Multilingual Text Summaries</h1>
<td class="en">Precipitation on Wednesday through Saturday, ...</td>
</tr>
</tbody>

<!-- FIXME: today -->
<!-- FIXME: tomorrow -->
<!-- FIXME: thursday -->
<!-- FIXME: friday -->
</table>

<script type="text/javascript" src="./src/darksky.js"></script>
Expand Down
12 changes: 12 additions & 0 deletions src/lang/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,18 @@ DarkSky.language("en", {
"stopping-later": function(duration) {
return "stopping " + duration + " later";
},
"temperatures-peaking": function(max, day) {
"temperatures peaking at " + max + " on " + day;
},
"temperatures-rising": function(max, day) {
"temperatures rising to " + max + " on " + day;
},
"temperatures-valleying": function(min, day) {
"temperatures bottoming out at " + min + " on " + day;
},
"temperatures-falling": function(min, day) {
"temperatures falling to " + min + " on " + day;
},
/* Capitalize the first letter of every word, except if that word is "and".
* (This is a very crude bastardization of proper English titling rules, but
* it is adequate for the purposes of this module.) */
Expand Down

0 comments on commit 11a63eb

Please sign in to comment.