Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mwe
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Redmine
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
nlpworkers
mwe
Commits
3382b078
Commit
3382b078
authored
5 years ago
by
Szymon Ciombor
Browse files
Options
Downloads
Patches
Plain Diff
removed camelCase
parent
c57c427a
1 merge request
!2
Python 3.6 port, CI, ready for deployment on Rancher
Pipeline
#957
passed with stage
in 47 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/worker.py
+7
-7
7 additions, 7 deletions
src/worker.py
with
7 additions
and
7 deletions
src/worker.py
+
7
−
7
View file @
3382b078
...
...
@@ -24,26 +24,26 @@ class Worker(nlp_ws.NLPWorker):
self
.
tagset
=
ccl
.
get_tagset
(
"
nkjp
"
)
self
.
reader
=
None
def
process
(
self
,
input
F
ile
,
task
O
ptions
,
output
F
ile
):
def
process
(
self
,
input
_f
ile
,
task
_o
ptions
,
output
_f
ile
):
"""
Runs a single nlp_task.
"""
_validate_xml
(
input
F
ile
)
_validate_xml
(
input
_f
ile
)
if
not
self
.
reader
:
self
.
reader
=
mwe
.
CclMWEReader
(
input
F
ile
,
self
.
tagset
)
self
.
reader
=
mwe
.
CclMWEReader
(
input
_f
ile
,
self
.
tagset
)
self
.
reader
.
use_annotations
(
False
)
else
:
self
.
reader
.
set_files
(
input
F
ile
)
self
.
reader
.
set_files
(
input
_f
ile
)
mwe_doc
=
self
.
reader
.
read
()
ccl
.
write_ccl
(
mwe_doc
,
str
(
output
F
ile
))
ccl
.
write_ccl
(
mwe_doc
,
str
(
output
_f
ile
))
class
_InvalidXMLInRequest
(
Exception
):
pass
def
_validate_xml
(
xmlfile
):
def
_validate_xml
(
xml
_
file
):
"""
Will do nothing if XML is valid and raise exception if it
'
s not.
"""
lint_call
=
subprocess
.
Popen
(
(
"
xmllint
"
,
"
--nonet
"
,
"
--noout
"
,
xmlfile
),
stderr
=
subprocess
.
PIPE
,
(
"
xmllint
"
,
"
--nonet
"
,
"
--noout
"
,
xml
_
file
),
stderr
=
subprocess
.
PIPE
,
)
lint_call
.
communicate
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
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