1 // Generated by LiveScript 1.2.0
3 var prelude, map, sortBy, fl, closestString, nameToRaw, dasherize;
4 prelude = require('prelude-ls'), map = prelude.map, sortBy = prelude.sortBy;
5 fl = require('fast-levenshtein');
6 closestString = function(possibilities, input){
7 var distances, ref$, string, distance;
8 if (!possibilities.length) {
11 distances = map(function(it){
12 var ref$, longer, shorter;
13 ref$ = input.length > it.length
15 : [it, input], longer = ref$[0], shorter = ref$[1];
18 distance: fl.get(longer, shorter)
22 ref$ = sortBy(function(it){
24 }, distances)[0], string = ref$.string, distance = ref$.distance;
27 nameToRaw = function(name){
28 if (name.length === 1 || name === 'NUM') {
34 dasherize = function(string){
35 if (/^[A-Z]/.test(string)) {
38 return prelude.dasherize(string);
42 closestString: closestString,