mirror of
				https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
				synced 2025-11-03 20:02:47 +00:00 
			
		
		
		
	push
This commit is contained in:
		@@ -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]);
 | 
			
		||||
        }
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user