Skip to content

Commit

Permalink
Merge pull request #125 from thorge/bugfix/fix-quantityType-whitespac…
Browse files Browse the repository at this point in the history
…e-replace

Replace all whitespaces in quantityType and colorLabel
  • Loading branch information
lfoppiano committed Aug 10, 2021
2 parents 359f931 + c39347c commit 67334cc
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/main/resources/web/grobid/grobid-quantities.js
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,8 @@ var grobid = (function ($) {
startUnit = parseInt(unit.offsetStart, 10);
endUnit = parseInt(unit.offsetEnd, 10);
}
if (quantityType)
quantityType = quantityType.replaceAll(" ", "_");
var start = parseInt(quantity.offsetStart, 10);
var end = parseInt(quantity.offsetEnd, 10);
if ((startUnit != -1) && ((startUnit == end) || (startUnit == end + 1)))
Expand Down Expand Up @@ -732,7 +734,7 @@ var grobid = (function ($) {
colorLabel = quantityLeast.rawName;
}
if (colorLabel)
colorLabel = colorLabel.replace(" ", "_");
colorLabel = colorLabel.replaceAll(" ", "_");
var leastValue = quantityLeast.rawValue;
var startUniLeast = -1;
var endUnitLeast = -1;
Expand Down Expand Up @@ -825,7 +827,10 @@ var grobid = (function ($) {
} else {
colorLabel = quantity.rawName;
}


if (colorLabel)
colorLabel = colorLabel.replaceAll(" ", "_");

var rawValue = quantity.rawValue;
var unit = quantity.rawUnit;

Expand Down

0 comments on commit 67334cc

Please sign in to comment.