function n = char2num(c)
switch c 
    case ' '
        n=0;
    case 'a'
        n=1;
    case 'b'
        n=2;
    case 'c'
        n=3;
    case 'd'
        n=4;
    case 'e'
        n=5;
    case 'f'
        n=6;
    case 'g'
        n=7;
    case 'h'
        n=8;
    case 'i'
        n=9;
    case 'j'
        n=10;
    case 'k'
        n=11;
    case 'l'
        n=12;
    case 'm'
        n=13;
    case 'n'
        n=14;
    case 'o'
        n=15;
    case 'p'
        n=16;
    case 'q'
        n=17;
    case 'r'
        n=18;
    case 's'
        n=19;
    case 't'
        n=20;
    case 'u'
        n=21;
    case 'v'
        n=22;
    case 'w'
        n=23;
    case 'x'
        n=24;
    case 'y'
        n=25;
    case 'z'
        n=26;
    case ''''
        n=27;
    case ','
        n=28;
    case '.'
        n=29;
    case ':'
        n=30;
    otherwise
        n=-1;
end
    