Skip to content

Commit

Permalink
handle n/a morph code
Browse files Browse the repository at this point in the history
  • Loading branch information
patricksptang committed Sep 30, 2024
1 parent 1819f40 commit 7ba7fd2
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion step-web/src/main/webapp/js/step.util.js
Original file line number Diff line number Diff line change
Expand Up @@ -4058,6 +4058,14 @@ step.util = {
var numOfMorphResponse = 0;
var morphArray = morph.split(" ");
resultJson.morphInfos = new Array(morphArray.length);
// for (var k = 0; k < morphArray.length; k++) {
// var currentMorph = morphArray[k];
// if (currentMorph === "n/a") {
// numOfMorphResponse ++;
// resultJson.morphInfos[k] = {};
// break;
// }
// }
for (var k = 0; k < morphArray.length; k++) {
var currentMorph = morphArray[k];
var morphLowerCase = currentMorph.toLowerCase();
Expand Down Expand Up @@ -4715,7 +4723,10 @@ step.util = {
return false;
},
convertMorphOSHM2TOS: function(curMorphs) {
if ((typeof curMorphs !== "string") || (curMorphs.substring(0, 5) !== "oshm:"))
if (typeof curMorphs !== "string")
return curMorphs;
curMorphs = curMorphs.replace(/n\/a/g, "nomorph");
if (curMorphs.substring(0, 5) !== "oshm:")
return curMorphs;
var morphs = curMorphs.substring(5).split("/");
var result = morphs[0];
Expand Down

0 comments on commit 7ba7fd2

Please sign in to comment.