Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
speller2
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
speller2
Commits
0a7a861c
Commit
0a7a861c
authored
4 years ago
by
Kamil Kanclerz
Browse files
Options
Downloads
Patches
Plain Diff
Remove unused imports
parent
b654f6d6
No related merge requests found
Pipeline
#2299
passed with stages
in 2 minutes and 39 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/speller2_worker.py
+1
-7
1 addition, 7 deletions
src/speller2_worker.py
with
1 addition
and
7 deletions
src/speller2_worker.py
+
1
−
7
View file @
0a7a861c
"""
Implementation of nlp_worker.
"""
"""
Implementation of nlp_worker.
"""
import
io
import
json
import
logging
import
logging
import
nlp_ws
import
nlp_ws
...
@@ -26,16 +24,12 @@ class Speller2Worker(nlp_ws.NLPWorker):
...
@@ -26,16 +24,12 @@ class Speller2Worker(nlp_ws.NLPWorker):
model
=
self
.
_model
model
=
self
.
_model
data
=
self
.
_read_file
(
input_file
)
data
=
self
.
_read_file
(
input_file
)
print
(
data
.
split
(
'
\n
'
))
corrected_data
=
[
model
(
line
)
for
line
in
data
.
split
(
'
\n
'
)]
corrected_data
=
[
model
(
line
)
for
line
in
data
.
split
(
'
\n
'
)]
with
open
(
output_file
,
'
w
'
,
encoding
=
'
utf-8
'
)
as
f
:
with
open
(
output_file
,
'
w
'
,
encoding
=
'
utf-8
'
)
as
f
:
f
.
write
(
'
\n
'
.
join
(
corrected_data
))
f
.
write
(
'
\n
'
.
join
(
corrected_data
))
#with io.open(output_file, 'w', encoding='utf-8') as f:
#json.dump(corrected_data, f, ensure_ascii=False)
#for line in corrected_data:
@classmethod
@classmethod
def
_read_file
(
cls
,
input_path
):
def
_read_file
(
cls
,
input_path
):
"""
Reading text from input file.
"""
"""
Reading text from input file.
"""
...
...
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