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
1aa27aea
Commit
1aa27aea
authored
2 years ago
by
Tomasz Walkowiak
Browse files
Options
Downloads
Patches
Plain Diff
fixing typos
parent
e76aa3cb
No related merge requests found
Pipeline
#9210
passed with stages
in 1 minute and 12 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/speller2_worker.py
+3
-1
3 additions, 1 deletion
src/speller2_worker.py
with
3 additions
and
1 deletion
src/speller2_worker.py
+
3
−
1
View file @
1aa27aea
...
@@ -6,6 +6,7 @@ from autocorrect import Speller, Word
...
@@ -6,6 +6,7 @@ from autocorrect import Speller, Word
_log
=
logging
.
getLogger
(
__name__
)
_log
=
logging
.
getLogger
(
__name__
)
class
SpellerFixed
(
Speller
):
class
SpellerFixed
(
Speller
):
"""
Fixes orginal speller in case of long words.
"""
"""
Fixes orginal speller in case of long words.
"""
...
@@ -18,7 +19,7 @@ class SpellerFixed(Speller):
...
@@ -18,7 +19,7 @@ class SpellerFixed(Speller):
w
=
Word
(
word
,
self
.
lang
,
self
.
only_replacements
)
w
=
Word
(
word
,
self
.
lang
,
self
.
only_replacements
)
if
self
.
fast
or
len
(
word
)
>
15
:
if
self
.
fast
or
len
(
word
)
>
15
:
candidates
=
(
self
.
existing
([
word
])
or
self
.
existing
(
w
.
typos
())
or
candidates
=
(
self
.
existing
([
word
])
or
self
.
existing
(
w
.
typos
())
or
[
word
])
[
word
])
else
:
else
:
candidates
=
(
candidates
=
(
self
.
existing
([
word
])
or
self
.
existing
([
word
])
or
...
@@ -28,6 +29,7 @@ class SpellerFixed(Speller):
...
@@ -28,6 +29,7 @@ class SpellerFixed(Speller):
)
)
return
[(
self
.
nlp_data
.
get
(
c
,
0
),
c
)
for
c
in
candidates
]
return
[(
self
.
nlp_data
.
get
(
c
,
0
),
c
)
for
c
in
candidates
]
class
Speller2Worker
(
nlp_ws
.
NLPWorker
):
class
Speller2Worker
(
nlp_ws
.
NLPWorker
):
"""
Implements nlp_worker for text error correction service.
"""
"""
Implements nlp_worker for text error correction service.
"""
...
...
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