Titles to detected areas

This commit is contained in:
Vojtěch Káně 2021-01-23 08:01:48 +01:00
parent 56a8752dd6
commit 6fab80cb28

View File

@ -41,9 +41,15 @@ export default {
span1.innerText = result.parsed_content.slice(i,detection[0][0]); span1.innerText = result.parsed_content.slice(i,detection[0][0]);
content.appendChild(span1); content.appendChild(span1);
const titles = {
"court": "Označení soudu",
"date_and_place": "Datum a čas sepsání",
};
const span2 = document.createElement("span"); const span2 = document.createElement("span");
span2.innerText = result.parsed_content.slice(detection[0][0], detection[0][1]); span2.innerText = result.parsed_content.slice(detection[0][0], detection[0][1]);
span2.classList.add(detection[1]); span2.classList.add(detection[1]);
span2.title = titles[detection[1]];
content.appendChild(span2); content.appendChild(span2);
i = detection[0][1]; i = detection[0][1];
} }