Skip to content

Instantly share code, notes, and snippets.

@lenagroeger
Created September 14, 2012 19:00
Show Gist options
  • Save lenagroeger/3723974 to your computer and use it in GitHub Desktop.
Save lenagroeger/3723974 to your computer and use it in GitHub Desktop.
stateface helper
<link rel="stylesheet" href="http://propublica.org/static/stateface/stateface.css" type="text/css" charset="utf-8" />
STATEFACE = {
"USA" => "z",
"AL" => "B",
"AK" => "A",
"AZ" => "D",
"AR" => "C",
"CA" => "E",
"CO" => "F",
"CT" => "G",
"DE" => "H",
"DC" => "y",
"FL" => "I",
"GA" => "J",
"HI" => "K",
"ID" => "M",
"IL" => "N",
"IN" => "O",
"IA" => "L",
"KS" => "P",
"KY" => "Q",
"LA" => "R",
"ME" => "U",
"MD" => "T",
"MA" => "S",
"MI" => "V",
"MN" => "W",
"MS" => "Y",
"MO" => "X",
"MT" => "Z",
"NE" => "c",
"NV" => "g",
"NH" => "d",
"NJ" => "e",
"NM" => "f",
"NY" => "h",
"NC" => "a",
"ND" => "b",
"OH" => "i",
"OK" => "j",
"OR" => "k",
"PA" => "l",
"RI" => "m",
"SC" => "n",
"SD" => "o",
"TN" => "p",
"TX" => "q",
"UT" => "r",
"VT" => "t",
"VA" => "s",
"WA" => "u",
"WV" => "w",
"WI" => "v",
"WY" => "x"
}
def statefaceize(terms)
terms = STATEFACE[terms]
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment