JavaScript Library

Download whatfreewords.js ⇩

Or try the live demo.

Usage

The entire library is a single file whatfreewords.js.

In nodejs:

let WhatFreeWords = require('./whatfreewords.js');
let words  = WhatFreeWords.latlon2words(37.234332, -115.806657)  // == "joyful.nail.harmonica"
let latlon = WhatFreeWords.words2latlon("joyful.nail.harmonica") // == [37.234328,-115.806657]

In the browser:

<script src="whatfreewords.js"></script>
let words  = WhatFreeWords.latlon2words(37.234332, -115.806657)  // == "joyful.nail.harmonica"
let latlon = WhatFreeWords.words2latlon("joyful.nail.harmonica") // == [37.234328,-115.806657]

Development

Download whatfreewords-js.tar.gz and extract it.

Because the library contains large amounts of data it is unpleasant to edit all at once, so the library is split into separate files in src/ which are combined together to make a single file.

The algorithm is all in src/main.js. Once you have made some changes, run make to combine the files in src/ into the bundle in ./whatfreewords.js.

The library is published under the Creative Commons CC0 license.