-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathoverlap.html
More file actions
80 lines (79 loc) · 2.41 KB
/
overlap.html
File metadata and controls
80 lines (79 loc) · 2.41 KB
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<head>
<script src="../data/bible.js"></script>
<script src="../data/morphhb.js"></script>
<script src="../data/kjv.js"></script>
<script>
var javascripture = {
data: {}
};
</script>
<script src="../data/strongs-dictionary.js"></script>
<script src="../data/strongsObjectWithFamilies2.js"></script>
<script src="map/lodash.min.js"></script>
</head>
<body>
<form class="form" id="form">
<p>
<select name="book1" id="book1">
<option>Select book</option>
</select>
<select name="chapter1" id="chapter1">
<option>-</option>
</select>
<select name="verse1" id="verse1">
<option>-</option>
</select>
</p>
<p>
<select name="book2" id="book2">
<option>Select book</option>
</select>
<select name="chapter2" id="chapter2">
<option>-</option>
</select>
<select name="verse2" id="verse2">
<option>-</option>
</select>
</p>
<input type="submit" value="Find connections" />
</form>
<div id="content"></div>
<script>
function submitForm( event ) {
event.preventDefault();
const ref1Book = document.getElementById( 'book1' ).value;
const ref2Book = document.getElementById( 'book2' ).value;
const ref1Chapter = document.getElementById( 'chapter1' ).value;
const ref2Chapter = document.getElementById( 'chapter2' ).value;
const ref1Verse = document.getElementById( 'verse1' ).value;
const ref2Verse = document.getElementById( 'verse2' ).value;
const ref1Lemmas = morphhb[ ref1Book ][ ref1Chapter - 1 ].map( verse => {
return verse.map( word => {
return word[ 1 ].split('/');
} ).flat();
} ).flat();
const ref2Lemmas = morphhb[ ref2Book ][ ref2Chapter - 1 ].map( verse => {
return verse.map( word => {
return word[ 1 ].split('/');
} ).flat();
} ).flat();
const overlap = ref1Lemmas.filter( lemma => {
if ( javascripture.data.strongsObjectWithFamilies[ lemma ].count < 500 ) {
if ( ref2Lemmas.indexOf( lemma ) > -1 ) {
return lemma;
}
}
} )
const content = document.getElementById('content')
content.innerHTML = '';
let contentHTML = 'connections: ' + overlap.length + '<br />';
overlap.forEach( lemma => {
contentHTML += lemma + ' ' + javascripture.data.strongsDictionary[ lemma ].kjv_def + '<br>';
} );
content.innerHTML = contentHTML;
console.log( contentHTML );
}
document.getElementById( 'form' ).onsubmit = submitForm;
</script>
<script src="overlap.js"></script>
</body>