Skip to content

Commit

Permalink
visualise paragraphs or sentences mutually exclusively if the segment…
Browse files Browse the repository at this point in the history
…ation is enabled
  • Loading branch information
lfoppiano committed Jan 18, 2024
1 parent 4d0acef commit 0d7913d
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion grobid-service/src/main/resources/web/grobid/grobid.js
Expand Up @@ -13,7 +13,7 @@ var grobid = (function($) {

var block = 0;

var elementCoords = ['s', 'biblStruct', 'persName', 'figure', 'formula', 'head', 'note', 'title', 'affiliation'];
var elementCoords = ['p', 's', 'biblStruct', 'persName', 'figure', 'formula', 'head', 'note', 'title', 'affiliation'];

function defineBaseURL(ext) {
var baseUrl = null;
Expand Down Expand Up @@ -239,10 +239,15 @@ var grobid = (function($) {

function ShowRequest1(formData, jqForm, options) {
var addCoordinates = false;
var segmentSentences = false;
for(var formd in formData) {
if (formData[formd].name == 'teiCoordinates') {
addCoordinates = true;
}
if (formData[formd].name == 'segmentSentences') {
segmentSentences = true;
}

}
if (addCoordinates) {
for (var i in elementCoords) {
Expand All @@ -252,6 +257,15 @@ var grobid = (function($) {
"type": "checkbox",
"required": false
}
if (segmentSentences === false) {
if (elementCoords[i] === "s") {
continue;
}
} else {
if (elementCoords[i] === "p") {
continue;
}
}
additionalFormData["value"] = elementCoords[i]
formData.push(additionalFormData)
}
Expand Down

0 comments on commit 0d7913d

Please sign in to comment.