diff --git a/common/tsakorpus_response_parser.py b/common/tsakorpus_response_parser.py index 7658d681fbfc67f760d163317169f3d2c7a998f9..10d7e68704dc1ea18dac8801629a91c5b9df91a0 100644 --- a/common/tsakorpus_response_parser.py +++ b/common/tsakorpus_response_parser.py @@ -83,6 +83,7 @@ class TsakorpusResponseParser: # (title, author etc.) if el.tail is not None: record.text += el.tail.strip('\n\t ') + record.textNoHighlight += el.text.strip('\n\t ') return if el.text is not None: @@ -90,7 +91,6 @@ class TsakorpusResponseParser: if 'class' in el.attrib and re.search('\\bword\\b', el.attrib['class']) is not None: if re.search('\\bwmatch\\b', el.attrib['class']) is not None: bMatch = True - record.textNoHighlight += el.text if advancedHits: segID = 's' + str(len(record.segments)) segment = { @@ -101,6 +101,7 @@ class TsakorpusResponseParser: record.segments.append(segment) if 'data-ana' in el.attrib: self.parse_annotation(el.attrib['data-ana'], segID, record) + record.textNoHighlight += el.text if bMatch: record.text += '<hits:Hit>' + el.text + '</hits:Hit>' else: