Skip to content
Snippets Groups Projects
Commit 5411bd91 authored by Patrick Jentsch's avatar Patrick Jentsch
Browse files

Fix imports and hardcoded values

parent 1f95c6de
No related branches found
No related tags found
No related merge requests found
from CQiClient import CQiClient
from CQi import CONST_FIELD_MATCH, CONST_FIELD_MATCHEND
from .CQiClient import CQiClient
from .CQi import CONST_FIELD_MATCH, CONST_FIELD_MATCHEND
import re
# from app import logger # only works if imported into opaque web app
from app import logger # only works if imported into opaque web app
class CQiWrapper(CQiClient):
......@@ -162,11 +162,11 @@ class CQiWrapper(CQiClient):
# print(all_cpos)
# Get all sentences IDs for all above collected cpos in all_cpos
s_ids = self.cl_cpos2struc('UTOPIEN.s', all_cpos) # CHANGE to CORPUS.s will always be like this in nopaque
s_ids = self.cl_cpos2struc('CORPUS.s', all_cpos) # CHANGE to CORPUS.s will always be like this in nopaque
# Get all cpos for all sneteces boundries
s_lookup = {}
for s_id in set(s_ids):
s_start, s_end = self.cl_struc2cpos('UTOPIEN.s', s_id) # CHANGE to CORPUS.s will always be like this in nopaque
s_start, s_end = self.cl_struc2cpos('CORPUS.s', s_id) # CHANGE to CORPUS.s will always be like this in nopaque
# print(s_start, s_end)
s_cpos = range(s_start, s_end)
s_lookup.update({s_id: list(s_cpos)})
......@@ -200,11 +200,11 @@ class CQiWrapper(CQiClient):
tmp_dict = {}
for struct_attr_key in self.attr_strings['struct_attrs'].keys():
check = self.attr_strings['struct_attrs'][struct_attr_key]
if check == 'UTOPIEN.s':
if check == 'CORPUS.s':
struct_ids = self.cl_cpos2struc(check, all_cpos)
for id in struct_ids:
tmp_s_info.append({struct_attr_key: id})
elif check == 'UTOPIEN.entry':
elif check == 'CORPUS.text':
struct_ids = self.cl_cpos2struc(check, all_cpos)
for id in struct_ids:
tmp_text_info.append({struct_attr_key: id})
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment