Skip to content

Commit

Permalink
fix lookup of morphology
Browse files Browse the repository at this point in the history
  • Loading branch information
patricksptang committed Dec 28, 2023
1 parent 4892a07 commit 8ff7bc5
Show file tree
Hide file tree
Showing 13 changed files with 45 additions and 23 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<groupId>com.tyndalehouse.step</groupId>
<artifactId>step-mvn</artifactId>
<version>23.12.4</version>
<version>23.12.5</version>
<packaging>pom</packaging>
<name>STEP :: Scripture Tools for Every pastor</name>

Expand Down
2 changes: 1 addition & 1 deletion step-assembly/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>step-mvn</artifactId>
<groupId>com.tyndalehouse.step</groupId>
<version>23.12.4</version>
<version>23.12.5</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<properties>
Expand Down
2 changes: 1 addition & 1 deletion step-build/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>com.tyndalehouse.step</groupId>
<artifactId>step-mvn</artifactId>
<version>23.12.4</version>
<version>23.12.5</version>
</parent>

<artifactId>step-build</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion step-core-data/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>com.tyndalehouse.step</groupId>
<artifactId>step-mvn</artifactId>
<version>23.12.4</version>
<version>23.12.5</version>
</parent>

<artifactId>step-core-data</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion step-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>com.tyndalehouse.step</groupId>
<artifactId>step-mvn</artifactId>
<version>23.12.4</version>
<version>23.12.5</version>
</parent>

<groupId>com.tyndalehouse.step</groupId>
Expand Down
2 changes: 1 addition & 1 deletion step-packages/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.tyndalehouse.step</groupId>
<artifactId>step-mvn</artifactId>
<version>23.12.4</version>
<version>23.12.5</version>
</parent>

<groupId>com.tyndalehouse.step</groupId>
Expand Down
2 changes: 1 addition & 1 deletion step-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<parent>
<groupId>com.tyndalehouse.step</groupId>
<artifactId>step-mvn</artifactId>
<version>23.12.4</version>
<version>23.12.5</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion step-test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.tyndalehouse.step</groupId>
<artifactId>step-mvn</artifactId>
<version>23.12.4</version>
<version>23.12.5</version>
</parent>

<groupId>com.tyndalehouse.step</groupId>
Expand Down
2 changes: 1 addition & 1 deletion step-tools/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>com.tyndalehouse.step</groupId>
<artifactId>step-mvn</artifactId>
<version>23.12.4</version>
<version>23.12.5</version>
</parent>

<groupId>com.tyndalehouse.step</groupId>
Expand Down
2 changes: 1 addition & 1 deletion step-war-precompiled/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>step-mvn</artifactId>
<groupId>com.tyndalehouse.step</groupId>
<version>23.12.4</version>
<version>23.12.5</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion step-web-test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.tyndalehouse.step</groupId>
<artifactId>step-mvn</artifactId>
<version>23.12.4</version>
<version>23.12.5</version>
</parent>

<groupId>com.tyndalehouse.step</groupId>
Expand Down
2 changes: 1 addition & 1 deletion step-web/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>com.tyndalehouse.step</groupId>
<artifactId>step-mvn</artifactId>
<version>23.12.4</version>
<version>23.12.5</version>
</parent>

<artifactId>step-web</artifactId>
Expand Down
44 changes: 33 additions & 11 deletions step-web/src/main/webapp/js/step.util.js
Original file line number Diff line number Diff line change
Expand Up @@ -3831,8 +3831,11 @@ step.util = {
}
}
}
if (indexToUniqueStrongArry == -1)
alert("something wrong, cannot locate original search Strong in getVocabMorphInfoFromJson");
if (indexToUniqueStrongArry == -1) {
console.log("something wrong, cannot locate original search Strong in getVocabMorphInfoFromJson");
callBackLoadDefFromAPI(callBack2Param);
return;
}
for (var i = 0; i < origJsonVar.v.length; i++) {
if (uniqueStrongArray[indexToUniqueStrongArry] !== requestedStrong) { // requestedStrong does not have augment
var strongNumToCheck = (typeof origJsonVar.v[i][0] === "number") ? origJsonVar.d[origJsonVar.v[i][0]] : origJsonVar.v[i][0];
Expand Down Expand Up @@ -3869,25 +3872,44 @@ step.util = {
if (morph) {
var numOfMorphResponse = 0;
var morphArray = morph.split(" ");
resultJson.morphInfos = new Array(morphArray.length);
for (var k = 0; k < morphArray.length; k++) {
numOfMorphResponse ++;
var morph = morphArray[k];
var morphLowerCase = morph.toLowerCase();
var currentMorph = morphArray[k];
var morphLowerCase = currentMorph.toLowerCase();
if ((morphLowerCase.indexOf("strongsmorph:") > -1) || (morphLowerCase.indexOf("strongmorph:") > -1) || (morphLowerCase.indexOf("tos:") > -1))
continue;
var pos = morph.search("robinson:");
if (pos > -1) morph = morphArray[k].substring(pos+9);
$.getJSON("/html/lexicon/" + additionalPath + morph + ".json", function(jsonVar) {
var pos = morphLowerCase.search("robinson:"); // need to check to see if this is still used
if (pos > -1) currentMorph = currentMorph.substring(pos+9);
$.getJSON("/html/lexicon/" + additionalPath + currentMorph + ".json", function(jsonVar) {
var indexToUniqueMorphArry = -1;
var requestedMorph = "";
if (morphArray.length > 1) {
if (this.url.search("\/([^.]+)\\.json$") > -1) {
requestedMorph = RegExp.$1;
for (var j = 0; j < morphArray.length; j++) {
if (requestedMorph === morphArray[j]) {
indexToUniqueMorphArry = j;
break;
}
}
}
}
else // most of the time, there is only one morph for SBLG, THGNT and THOT
indexToUniqueMorphArry = 0;
if (indexToUniqueMorphArry == -1) {
console.log("something wrong, cannot locate original search morph in getVocabMorphInfoFromJson");
callBackLoadDefFromAPI(callBack2Param);
return;
}
numOfMorphResponse ++;
resultJson.morphInfos.push(jsonVar.morphInfos[0]);
resultJson.morphInfos[indexToUniqueMorphArry] = jsonVar.morphInfos[0];
if (numOfMorphResponse == morphArray.length)
callProcessQuickInfo(resultJson, callBack1Param);
}).error(function() {
console.log("getJSon failed strong:"+ strong + " morph: " + morph + " version: " + version);
console.log("getJSon failed strong:"+ strong + " morph: " + currentMorph + " version: " + version);
if (numOfMorphResponse < 0) return; // already processed error from $getjson of /html/lexicon ...
numOfMorphResponse = -100;
callBackLoadDefFromAPI(callBack2Param);
//return false;
});
}
}
Expand Down

0 comments on commit 8ff7bc5

Please sign in to comment.