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
b654f6d6
Commit
b654f6d6
authored
4 years ago
by
Kamil Kanclerz
Browse files
Options
Downloads
Patches
Plain Diff
Change method of saving result to file
parent
5f20e113
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Pipeline
#2298
failed with stages
in 30 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/speller2_worker.py
+7
-3
7 additions, 3 deletions
src/speller2_worker.py
with
7 additions
and
3 deletions
src/speller2_worker.py
+
7
−
3
View file @
b654f6d6
...
...
@@ -26,11 +26,15 @@ class Speller2Worker(nlp_ws.NLPWorker):
model
=
self
.
_model
data
=
self
.
_read_file
(
input_file
)
print
(
data
.
split
(
'
\n
'
))
corrected_data
=
[
model
(
line
)
for
line
in
data
.
split
(
'
\n
'
)]
corrected_data
=
model
(
data
)
with
open
(
output_file
,
'
w
'
,
encoding
=
'
utf-8
'
)
as
f
:
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
)
#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
def
_read_file
(
cls
,
input_path
):
...
...
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