mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2025-06-18 20:10:39 +00:00
Rename some stuff
This commit is contained in:
@ -44,6 +44,7 @@ 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'] = {}
|
||||
@ -100,9 +101,8 @@ class CQiWrapper(CQiClient):
|
||||
+ ':'
|
||||
+ result_subcorpus_name)
|
||||
self.SUBCORPUS_NAMES.append(self.result_subcorpus)
|
||||
self.total_nr_matches = self.cqp_subcorpus_size(self.result_subcorpus)
|
||||
logger.warning('Nr of all matches is: {}'.format(self.total_nr_matches))
|
||||
logger.warning('Nr of all matches is: {}'.format(self.total_nr_matches))
|
||||
self.match_count = self.cqp_subcorpus_size(self.result_subcorpus)
|
||||
logger.warning('Nr of all matches is: {}'.format(self.match_count))
|
||||
|
||||
def show_subcorpora(self):
|
||||
'''
|
||||
@ -136,7 +136,7 @@ class CQiWrapper(CQiClient):
|
||||
self.corpus_max_len = self.cl_attribute_size(
|
||||
self.attr_strings['positional_attrs']['word']
|
||||
)
|
||||
self.nr_matches = min(result_len, self.total_nr_matches)
|
||||
self.nr_matches = min(result_len, self.match_count)
|
||||
if self.nr_matches == 0:
|
||||
logger.warning('Query resulted in 0 matches.')
|
||||
return None
|
||||
@ -147,7 +147,7 @@ class CQiWrapper(CQiClient):
|
||||
# [(1355, 1357), (1477, 1479)] Example for two boundry pairs
|
||||
offset_start = 0 if result_offset == 0 else result_offset
|
||||
logger.warning('Offset start is: {}'.format(offset_start))
|
||||
offset_end = min((self.nr_matches + result_offset - 1), self.total_nr_matches - 1)
|
||||
offset_end = min((self.nr_matches + result_offset - 1), self.match_count - 1)
|
||||
logger.warning('Offset end is: {}'.format(offset_end))
|
||||
match_boundaries = zip(self.cqp_dump_subcorpus(self.result_subcorpus,
|
||||
CONST_FIELD_MATCH,
|
||||
@ -196,11 +196,12 @@ class CQiWrapper(CQiClient):
|
||||
t_final = t3 - t2
|
||||
logger.warning('Got infos for {} CPOS in {} seconds:'.format(len_all_cpos,
|
||||
t_final))
|
||||
self.results = {'matches': all_matches,
|
||||
'cpos_lookup': all_cpos_infos,
|
||||
'text_lookup': text_lookup,
|
||||
'total_nr_matches': self.total_nr_matches,
|
||||
'query': self.query}
|
||||
self.results = {'code': 0,
|
||||
'result': {'matches': all_matches,
|
||||
'match_count': self.match_count,
|
||||
'cpos_lookup': all_cpos_infos,
|
||||
'text_lookup': text_lookup,}
|
||||
}
|
||||
return self.results
|
||||
|
||||
def get_cpos_infos(self, all_cpos):
|
||||
|
Reference in New Issue
Block a user