Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
nlpworkers
mwe
Commits
3382b078
Commit
3382b078
authored
Jul 23, 2020
by
Szymon Ciombor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
removed camelCase
parent
c57c427a
Pipeline
#957
passed with stage
in 47 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
src/worker.py
src/worker.py
+7
-7
No files found.
src/worker.py
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
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment