Skip to content
Snippets Groups Projects
Commit 6c9b4336 authored by Patrick Jentsch's avatar Patrick Jentsch
Browse files

push

parent 0f23cbe2
No related branches found
No related tags found
No related merge requests found
......@@ -122,6 +122,7 @@
console.log(results);
html_txt = '<table class="highlight"> <thead><tr><th>Title</th><th>Left context</th><th>Match</th><th>Right Context</th></tr></thead>';
for (let [key, hit] of Object.entries(results)) {
resultInfo(hit, "word");
var left_context = hit['left_context_cpos']
var match = hit['match_cpos']
var right_context = hit['right_context_cpos']
......@@ -137,10 +138,22 @@
queryResultsElement.innerHTML = html_txt;
}
});
function resultInfo(result) {
left = "";
for (let entry of result['left_context_cpos']) {
let foo = Object.values(entry)[0]
left += foo["simple_pos"] === "PUNCT" ? foo["word"] : " " + foo["word"];
}
console.log("Diese andere Info:");
console.log(left);
}
function getResultInfos(matchObject, info_key, slice) {
var infos = [];
for (let [infoKey, infoValue] of Object.entries(matchObject)) {
var token = infoValue;
for (let token of Object.values(matchObject)) {
for (let key in token) {
infos.push(token[key][info_key]);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment