Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
nopaque
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
Looking for advice? Join the
Matrix channel for GitLab users in Bielefeld
!
Show more breadcrumbs
SFB 1288 - INF
nopaque
Commits
5411bd91
Commit
5411bd91
authored
5 years ago
by
Patrick Jentsch
Browse files
Options
Downloads
Patches
Plain Diff
Fix imports and hardcoded values
parent
1f95c6de
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
app/corpora/CQiWrapper/CQiWrapper.py
+7
-7
7 additions, 7 deletions
app/corpora/CQiWrapper/CQiWrapper.py
with
7 additions
and
7 deletions
app/corpora/CQiWrapper/CQiWrapper.py
+
7
−
7
View file @
5411bd91
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
})
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment