This repository has been archived by the owner on Apr 27, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
literalConsistentHebrew.html
61 lines (60 loc) · 2.15 KB
/
literalConsistentHebrew.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body id="result"></body>
<script src="lib/jquery-2.0.3.min.js"></script>
<script type="text/javascript">
var javascripture = { data: {} };
</script>
<script src="data/strongs-dictionary.js"></script>
<script src="data/extra-dictionary.js"></script>
<script src="data/hebrew-with-morph.js"></script>
<script>
function getFromStrongsDictionary( lemma ) {
if (javascripture.data.strongsDictionary[lemma] && javascripture.data.strongsDictionary[lemma]['kjv_def']) {
return javascripture.data.strongsDictionary[lemma]['kjv_def'].split(',')[0];
} else {
console.log('todo: ' + lemma);
}
}
var literalConsistentHebrew = {};
for ( book in javascripture.data.hebrew ) {
javascripture.data.hebrew[ book ].forEach( function( chapter ) {
chapter.forEach( function( verse ) {
verse.forEach( function( word ) {
var lemmaArray, morphArray;
lemmaArray = word[1].split( / |\//g );
if ( word[2] ) {
morphArray = word[2].split( / |\//g );
}
lemmaArray.forEach( function( lemmaPart, key ) {
lemmaPart = lemmaPart.replace( '+', '' );
if ( 'undefined' !== typeof literalConsistentHebrew[ lemmaPart] ) {
if ( morphArray && morphArray[ key ] ) {
// There is a morph
if ( 'undefined' !== typeof literalConsistentHebrew[ lemmaPart ][ morphArray[ key ] ] ) {
// do nothing
} else {
literalConsistentHebrew[ lemmaPart ][ morphArray[ key ] ] = getFromStrongsDictionary( lemmaPart );
}
} else {
literalConsistentHebrew[ lemmaPart ]['no-morph'] = getFromStrongsDictionary( lemmaPart );
}
} else {
literalConsistentHebrew[ lemmaPart ] = {};
if ( morphArray ) {
// There is a morph
literalConsistentHebrew[ lemmaPart ][ morphArray[ key ] ] = getFromStrongsDictionary( lemmaPart );
} else {
literalConsistentHebrew[ lemmaPart ]['no-morph'] = getFromStrongsDictionary( lemmaPart );
}
}
});
});
});
});
}
document.getElementById( 'result' ).innerHTML = JSON.stringify( literalConsistentHebrew );
</script>
</html>