mirror of
				https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
				synced 2025-11-04 12:22:47 +00:00 
			
		
		
		
	Add first query result function
This commit is contained in:
		@@ -51,7 +51,7 @@ class CQiWrapper(CQiClient):
 | 
			
		||||
            self.attr_strings['positional_attrs'][p_attr] = (self.corpus_name
 | 
			
		||||
                                                             + '.'
 | 
			
		||||
                                                             + p_attr)
 | 
			
		||||
        for struct_attr in struct_attrs[:-1]:
 | 
			
		||||
        for struct_attr in struct_attrs[2:-1]:
 | 
			
		||||
            self.attr_strings['struct_attrs'][struct_attr] = (self.corpus_name
 | 
			
		||||
                                                              + '.'
 | 
			
		||||
                                                              + struct_attr)
 | 
			
		||||
@@ -64,7 +64,6 @@ class CQiWrapper(CQiClient):
 | 
			
		||||
            self.__create_attribute_strings()
 | 
			
		||||
            logger.warning('{} does exist.'.format(corpus_name))
 | 
			
		||||
        else:
 | 
			
		||||
            self.disconnect()
 | 
			
		||||
            logger.warning('{} does not exist.'.format(corpus_name))
 | 
			
		||||
 | 
			
		||||
    def disconnect(self):
 | 
			
		||||
@@ -126,7 +125,6 @@ class CQiWrapper(CQiClient):
 | 
			
		||||
        self.nr_matches = min(result_len, self.nr_matches)
 | 
			
		||||
        if self.nr_matches == 0:
 | 
			
		||||
            logger.warning('Query resulted in 0 matches.')
 | 
			
		||||
            self.disconnect
 | 
			
		||||
            return None
 | 
			
		||||
        else:
 | 
			
		||||
            # Get match cpos boundries
 | 
			
		||||
@@ -227,11 +225,14 @@ class CQiWrapper(CQiClient):
 | 
			
		||||
                                                 all_cpos)
 | 
			
		||||
                    cpos_infos[p_attr_key] = match_str
 | 
			
		||||
            elif attr_dict == 'struct_attrs':
 | 
			
		||||
                for struct_attr_key in self.attr_strings[attr_dict].keys():
 | 
			
		||||
                    struct_entry = self.cl_cpos2struc(self.attr_strings['struct_attrs'][self.meta_struct_element],
 | 
			
		||||
                                                      all_cpos)
 | 
			
		||||
                    match_str = self.cl_struc2str(self.attr_strings[attr_dict][struct_attr_key], struct_entry)
 | 
			
		||||
                    cpos_infos[struct_attr_key] = match_str
 | 
			
		||||
                # for struct_attr_key in self.attr_strings[attr_dict].keys():
 | 
			
		||||
                #     logger.warning('HIER:' + struct_attr_key + " " + " " + self.attr_strings[attr_dict][struct_attr_key])
 | 
			
		||||
                #     struct_entry = self.cl_cpos2struc(self.attr_strings['struct_attrs'][self.meta_struct_element],
 | 
			
		||||
                #                                       all_cpos)
 | 
			
		||||
                #     logger.warning(struct_entry)
 | 
			
		||||
                #     match_str = self.cl_struc2str(self.attr_strings[attr_dict][struct_attr_key], struct_entry)
 | 
			
		||||
                #     cpos_infos[struct_attr_key] = match_str
 | 
			
		||||
                pass
 | 
			
		||||
        tmp_list = []
 | 
			
		||||
        attr_key_list = []
 | 
			
		||||
        for key in cpos_infos.keys():
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user