### WLC Prefix Form Example
Source: https://github.com/openscriptures/morphhb/blob/master/WlcWordList/WlcWordList.html
An example of a prefix form element in the WLC Word List, showing its consonantal form and augmented Strong number.
```xml
6609
```
--------------------------------
### Morphological Parsing Example
Source: https://github.com/openscriptures/morphhb/blob/master/parsing/HebrewMorphologyCodes.html
An example of morphological parsing applied to a Hebrew verse, showing lemma and morph attributes.
```xml
בְּ/רֵאשִׁ֖ית
בָּרָ֣א
אֱלֹהִ֑ים
אֵ֥ת
הַ/שָּׁמַ֖יִם
וְ/אֵ֥ת
הָ/אָֽרֶץ׃
```
--------------------------------
### JavaScript Event Listener for Conversion Start
Source: https://github.com/openscriptures/morphhb/blob/master/oxlos-import/export.html
Attaches a click event listener to a button with the ID 'go' to initiate the WLC conversion process.
```javascript
document.getElementById('go').addEventListener('click', function () {
buildWlc();
}, true);
```
--------------------------------
### WLC Prefix Form with Morphology
Source: https://github.com/openscriptures/morphhb/blob/master/WlcWordList/WlcWordList.html
An example of a prefix form element with its morphology attribute specified.
```xml
6609
```
--------------------------------
### WLC Word Form Example
Source: https://github.com/openscriptures/morphhb/blob/master/WlcWordList/WlcWordList.html
An example of a word form element in the WLC Word List, including its consonantal form, vowel form, and augmented Strong number.
```xml
Gen.1.1
```
--------------------------------
### WLC Word Form with Morphology
Source: https://github.com/openscriptures/morphhb/blob/master/WlcWordList/WlcWordList.html
An example of a word form element with morphology and level attributes specified for its reference.
```xml
Gen.1.1
```
--------------------------------
### JavaScript AJAX GET Request Function
Source: https://github.com/openscriptures/morphhb/blob/master/oxlos-import/export.html
A utility function to perform asynchronous GET requests. It handles success and error callbacks for fetching resources.
```javascript
function ajaxGet(obj) {
var xhr = new XMLHttpRequest();
xhr.open("GET", obj.url, true);
xhr.onreadystatechange = function () {
//console.log(xhr);
if (xhr.readyState == 4) {
obj.success(xhr);
} else {
if (obj.error) obj.error(xhr);
}
};
xhr.send(null);
}
```
--------------------------------
### Example Word Tag Attributes
Source: https://github.com/openscriptures/morphhb/blob/master/README.md
Illustrates the format of lemma, morphology, and unique ID attributes within word tags in the OSHB project.
```text
lemma - Eg. c/m/6529
morph - Eg. HC/R/Ncmsc
id - Eg. 018xz
```
--------------------------------
### Build and Run Docker Image
Source: https://github.com/openscriptures/morphhb/blob/master/README.md
Builds the Docker image for the morphhb project and runs the container, mounting the current directory.
```bash
docker build . -t local/morphhb && docker run -it -v `pwd`:/var/app local/morphhb
```
--------------------------------
### JavaScript WLC XML to Flat File Conversion Logic
Source: https://github.com/openscriptures/morphhb/blob/master/oxlos-import/export.html
The main logic for converting WLC XML files. It orchestrates the loading, processing, and outputting of book data.
```javascript
var bookNames = ["Gen","Exod","Lev","Num", "Deut", "Josh", "Judg", "Ruth","1Sam","2Sam","1Kgs","2Kgs","1Chr", "2Chr","Ezra","Neh","Esth","Job","Ps","Prov","Eccl","Song","Isa","Jer","Lam","Ezek","Dan","Hos","Joel","Amos","Obad","Jonah","Mic","Nah","Hab","Zeph","Hag","Zech","Mal"];
var output = document.getElementById('output');
var progress = document.getElementById('progress-info');
var startTime = null;
var outputArray = [];
// adjust these to only do a few books
var currentBook = 0;
var maxbook = bookNames.length;
//maxbook = 4; // temp
function buildWlc() {
startTime = new Date().getTime(); ;
buildNextBook();
}
function buildNextBook() {
if (currentBook < maxbook) {
processBook(bookNames[currentBook]);
currentBook++;
} else {
progress.innerHTML = 'Writing output (this takes a bit)';
output.value = outputArray.join('\n');
/*
var win = window.open('null', '_blank', 'toolbar=yes');
win.document.open();
win.document.write(outputArray.join('\n'));
win.document.close();
*/
var end = new Date().getTime();
var elapsed = end - startTime;
var seconds = (elapsed / 1000) % 60;
var minutes = (elapsed / (1000 * 60)) % 60;
if (minutes < 1) minutes = 0;
progress.innerHTML = 'Done: ' + minutes + 'min ' + seconds + 'sec';
}
}
function processBook(bookName) {
var chapterNum = 0;
var verseNum = 0;
var wordNum = 0;
progress.innerHTML = 'Loading: ' + bookName;
ajaxGet({
url: 'wlc/' + bookName + '.xml',
success: function (xhr) {
progress.innerHTML = 'Processing: ' + bookName;
var xml = xhr.responseXML;
// iterate through chapters
var chapterNodes = xml.getElementsByTagName('chapter');
for (var cIndex = 0; cIndex < chapterNodes.length; cIndex++) {
var chapterNode = chapterNodes[cIndex];
// iterate through verses
var verseNodes = chapterNode.getElementsByTagName('verse');
for (var vIndex = 0; vIndex < verseNodes.length; vIndex++) {
var verseNode = verseNodes[vIndex];
// parse OSIS
var osisID = verseNode.getAttribute('osisID');
var osisParts = osisID.split('.');
chapterNum = osisParts[1];
verseNum = osisParts[2];
wordNum = 0; // start with 0 for kethiv/qere
// work through the text nodes (some words, some qere)
for (tIndex = 0; tIndex < verseNode.childNodes.length; tIndex++) {
var textNode = verseNode.childNodes[tIndex];
// skip text nodes
if (textNode.nodeType != 1) continue;
// main data
var strongsNum = textNode.getAttribute('lemma');
if (strongsNum == null) strongsNum = '';
var wordText = textNode.childNodes[0].nodeValue;
// (1) if this is a punctuation mark (- or :), add it to the end of the previous entry
if (textNode.tagName == "seg") {
outputArray[outputArray.length - 1] += wordText;
continue;
}
// (2) Qere
if (textNode.tagName == "note" && textNode.getAttribute("type") != null && textNode.getAttribute("type") == "variant") {
var qereNode = textNode.getElementsByTagName('w')[0];
if (qereNode != null && qereNode.nodeType == 1) {
var qereText = qereNode.childNodes[0].nodeValue;
var qereStrongs = qereNode.getAttribute('lemma');
if (qereStrongs == null) qereStrongs = '';
outputArray.push(bookName + ' ' + chapterNum + ':' + verseNum + '.' + wordNum + 'q\t' + qereStrongs + '\t' + qereText);
}
continue;
}
// (3) normal node
if (textNode.tagName == 'w') {
wordNum++;
var isKethiv = (textNode.nextSibling != null && textNode.nextSibling.tagName == 'note' && textNode.nextSibling.getAttribute('type') == "variant");
outputArray.push(bookName + ' ' + chapterNum + ':' + verseNum + '.' + wordNum + ((isKethiv) ? 'k' : '') + '\t' + strongsNum + '\t' + wordText);
}
}
// words
}
// verses
}
// chapters
//output.value += outputArray.join('\n');
buildNextBook();
},
error: function (e) {
}
});
}
```
--------------------------------
### Perl Script for JSON Output
Source: https://github.com/openscriptures/morphhb/blob/master/README.md
Demonstrates how to run the morphhbXML-to-JSON.pl script with various options to generate a JSON version of the Hebrew Bible morphology data. This script is used to create the npm package 'morphhb'.
```bash
perl morphhbXML-to-JSON.pl --stripPointing --removeLemmaTypes --prefixLemmasWithH --remapVerses
```
--------------------------------
### Preposition Types
Source: https://github.com/openscriptures/morphhb/blob/master/parsing/HebrewMorphologyCodes.html
Codes for different types of prepositions, specifically noting the definite article.
```text
d definite article
```
--------------------------------
### Suffix Types
Source: https://github.com/openscriptures/morphhb/blob/master/parsing/HebrewMorphologyCodes.html
Codes for different types of suffixes.
```text
d directional he
h paragogic he
n paragogic nun
p pronominal
```
--------------------------------
### Particle Types
Source: https://github.com/openscriptures/morphhb/blob/master/parsing/HebrewMorphologyCodes.html
Codes for different types of particles.
```text
a affirmation
d definite article
e exhortation
i interrogative
j interjection
m demonstrative
n negative
o direct object marker
r relative
```
--------------------------------
### Pronoun Types
Source: https://github.com/openscriptures/morphhb/blob/master/parsing/HebrewMorphologyCodes.html
Codes for different types of pronouns.
```text
d demonstrative
f indefinite
i interrogative
p personal
r relative
```
--------------------------------
### Aramaic Verb Stems
Source: https://github.com/openscriptures/morphhb/blob/master/parsing/HebrewMorphologyCodes.html
Codes representing different Aramaic verb stems.
```text
q peal
Q peil
u hithpeel
p pael
P ithpaal
M hithpaal
a aphel
h haphel
s saphel
e shaphel
H hophal
i ithpeel
t hishtaphel
v ishtaphel
w hithaphel
o polel
z ithpoel
r hithpolel
f hithpalpel
b hephal
c tiphel
m poel
l palpel
L ithpalpel
O ithpolel
G ittaphal
```
--------------------------------
### Noun Types
Source: https://github.com/openscriptures/morphhb/blob/master/parsing/HebrewMorphologyCodes.html
Codes for different types of nouns.
```text
c common
g gentilic
p proper name
```
--------------------------------
### Hebrew Verb Stems
Source: https://github.com/openscriptures/morphhb/blob/master/parsing/HebrewMorphologyCodes.html
Codes representing different Hebrew verb stems.
```text
q qal
N niphal
p piel
P pual
h hiphil
H hophal
t hithpael
o polel
O polal
r hithpolel
m poel
M poal
k palel
K pulal
Q qal passive
l pilpel
L polpal
f hithpalpel
D nithpael
j pealal
i pilel
u hothpaal
c tiphil
v hishtaphel
w nithpalel
y nithpoel
z hithpoel
```
--------------------------------
### Verb Conjugation Types
Source: https://github.com/openscriptures/morphhb/blob/master/parsing/HebrewMorphologyCodes.html
Codes for different Hebrew verb conjugation types.
```text
p perfect (_qatal_)
q sequential perfect (_weqatal_)
i imperfect (_yiqtol_)
w sequential imperfect (_wayyiqtol_)
h cohortative
j jussive
v imperative
r participle active
s participle passive
a infinitive absolute
c infinitive construct
```
--------------------------------
### Adjective Types
Source: https://github.com/openscriptures/morphhb/blob/master/parsing/HebrewMorphologyCodes.html
Codes for different types of adjectives.
```text
a adjective
c cardinal number
g gentilic
o ordinal number
```
--------------------------------
### State Codes
Source: https://github.com/openscriptures/morphhb/blob/master/parsing/HebrewMorphologyCodes.html
Codes representing grammatical state.
```text
a absolute
c construct
d determined
```
--------------------------------
### Gender Codes
Source: https://github.com/openscriptures/morphhb/blob/master/parsing/HebrewMorphologyCodes.html
Codes representing grammatical gender.
```text
b both (noun)
c common (verb)
f feminine
m masculine
```
--------------------------------
### Number Codes
Source: https://github.com/openscriptures/morphhb/blob/master/parsing/HebrewMorphologyCodes.html
Codes representing grammatical number.
```text
d dual
p plural
s singular
```
--------------------------------
### Person Codes
Source: https://github.com/openscriptures/morphhb/blob/master/parsing/HebrewMorphologyCodes.html
Codes representing grammatical person.
```text
1 first
2 second
3 third
```
--------------------------------
### Language Codes
Source: https://github.com/openscriptures/morphhb/blob/master/parsing/HebrewMorphologyCodes.html
Codes indicating the language of the morphological parsing.
```text
H Hebrew
A Aramaic
```
=== COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.