mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2025-06-19 04:20:40 +00:00
NEw analysis stuff
This commit is contained in:
@ -44,7 +44,6 @@ class CQiWrapper(CQiClient):
|
||||
'''
|
||||
p_attrs = self.corpus_positional_attributes(self.corpus_name)
|
||||
struct_attrs = self.corpus_structural_attributes(self.corpus_name)
|
||||
logger.warning('struct_attrs: {}'.format(struct_attrs))
|
||||
self.attr_strings = {}
|
||||
self.attr_strings['positional_attrs'] = {}
|
||||
self.attr_strings['struct_attrs'] = {}
|
||||
@ -137,9 +136,15 @@ class CQiWrapper(CQiClient):
|
||||
self.attr_strings['positional_attrs']['word']
|
||||
)
|
||||
self.nr_matches = min(result_len, self.match_count)
|
||||
if self.nr_matches == 0:
|
||||
if self.match_count == 0:
|
||||
logger.warning('Query resulted in 0 matches.')
|
||||
return None
|
||||
self.results = {'code': 0,
|
||||
'result': {'matches': [],
|
||||
'match_count': self.match_count,
|
||||
'cpos_lookup': {},
|
||||
'text_lookup': {}}
|
||||
}
|
||||
return self.results
|
||||
else:
|
||||
# Get match cpos boundries
|
||||
# match_boundries shows the start and end cpos of one match as a
|
||||
@ -200,7 +205,7 @@ class CQiWrapper(CQiClient):
|
||||
'result': {'matches': all_matches,
|
||||
'match_count': self.match_count,
|
||||
'cpos_lookup': all_cpos_infos,
|
||||
'text_lookup': text_lookup,}
|
||||
'text_lookup': text_lookup}
|
||||
}
|
||||
return self.results
|
||||
|
||||
|
Reference in New Issue
Block a user