I have 2 sets of numbers, one representing Hebrew and the other Greek. How to fix this problem?
Code:
<!--
function getKeyValue(chr) {
chr=chr.toLowerCase();
if(chr=="(") return 1;
if(chr=="b") return 2;
if(chr=="g") return 3;
if(chr=="d") return 4;
if(chr=="h") return 5;
if(chr=="w") return 6;
if(chr=="x") return 8;
if(chr=="+") return 9;
if(chr=="y") return 10;
if(chr=="k" || chr=="j") return 20;
if(chr=="l") return 30;
if(chr=="m" || chr=="e") return 40;
if(chr=="n" || chr=="a") return 50;
if(chr=="s") return 60;
if(chr==")") return 70;
if(chr=="p" || chr=="=" || chr=="v") return 80;
if(chr=="c" || chr=="u") return 90;
if(chr=="q") return 100;
if(chr=="r") return 200;
if(chr=="$" || chr=="%" || chr=="&") return 300;
if(chr=="t") return 400;
return 0;
}
function computeValue(str) {
var ans=0;
for(var i=0; i<str.length; i++) {
ans+=getKeyValue(str.charAt(i));
}
return ans;
}
function getKeyValue(chr) {
chr=chr.toLowerCase();
if(chr=="1") return 1;
if(chr=="b") return 2;
if(chr=="g") return 3;
if(chr=="d") return 4;
if(chr=="e") return 5;
if(chr=="h") return 8;
if(chr=="q") return 9;
if(chr=="i") return 10;
if(chr=="k") return 20;
if(chr=="l") return 30;
if(chr=="m") return 40;
if(chr=="n") return 50;
if(chr=="c") return 60;
if(chr=="o") return 70;
if(chr=="p") return 80;
if(chr=="c") return 90;
if(chr=="r") return 100;
if(chr=="s" || chr=="v") return 200;
if(chr=="t") return 300;
if(chr=="u") return 400;
if(chr=="f") return 500;
if(chr=="x") return 600;
if(chr=="y") return 700;
if(chr=="w") return 800;
return 0;
}
function computeValue(str) {
var ans=0;
for(var i=0; i<str.length; i++) {
ans+=getKeyValue(str.charAt(i));
}
return ans;
}
...
Drag and enter a Hebrew word from the <a href="http://www.studylight.org/isb/bible.cgi?query=gen+1%3A1§ion=0&it=kjv&ot=bhs&nt=na" target="_blank">Interlinear</a>
<p>
<input type="text" id="hInput">
<input type="button" value="calculate value" onclick="calc('hInput', 'hOutput')">
<input type="text" id="hOutput" readonly="true">
</p>
<p></BDO>
</p>
<input type="text" id="gInput">
<input type="button" value="calculate value" onclick="calc('gInput', 'gOutput')">
<input type="text" id="gOutput" readonly="true">
</p>
<p></BDO>
</p>