This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Language constants. | |
var x = ' hen di tri tetra penta hexa hepta octa ennea deca hendeca dodeca triskaideca tetrakaideca pentakaideca hexakaideca heptakaideca octakaideca enneakaideca icosa'.split(' '); | |
var y = ' ,,icosa,conta ,hecato,diacosio,cosioi ,chilia,diachilia,chilia'.split(' ').map(function(s){return s.split(',')}); | |
var z = x.map(function(x){return x+(x[x.length-1]==='a'?'':'a')}); | |
// Convert any number - up to a few thousand, to a numeric prefix. | |
function grekify(n){ | |
n = String(n); // Greek numbers are deca-mal | |
return x[n] || n && [(n[0]>2?z[n[0]]:''),y[n.length][n[0]>2?3:n[0]],grekify(n.slice(1))].join(''); | |
} |