Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spell Checker #80

Merged
merged 11 commits into from
Jan 9, 2018
Merged

Spell Checker #80

merged 11 commits into from
Jan 9, 2018

Conversation

JPJPJPOPOP
Copy link
Contributor

@JPJPJPOPOP JPJPJPOPOP force-pushed the master branch 2 times, most recently from 16c83bd to ac2cbda Compare January 7, 2018 08:10
@sushain97
Copy link
Member

We need to ignore streamparser. Modifying the Travis mypy command similarly should work: python/mypy#626 (comment)

Copy link
Member

@sushain97 sushain97 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Final run through. This is almost mergeable.

modeSearch.py Outdated
'tagger': re.compile(r'(({0}(-{0})?)-tagger)\.mode'.format(lang_code))
'tagger': re.compile(r'(({0}(-{0})?)-tagger)\.mode'.format(lang_code)),
'spell': re.compile(r'(({0}(-{0})?)-spell)\.mode'.format(lang_code)),
'tokenise': re.compile(r'(({0}(-{0})?)-tokenise)\.mode'.format(lang_code))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add trailing comma

servlet.py Outdated
if line.count('Corrections for'):
foundSugg = True
continue
if foundSugg and ' ' in line:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In think it's much clear if this and below are \t

servlet.py Outdated

result = yield translation.translateSimple(token.wordform, commands)
foundSugg = False
for line in result.split('\n'):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

splitlines?

servlet.py Outdated

self.sendResponse(units)
else:
logging.info('Spellchecker not working')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this bad?? they input a wrong pair, right?

servlet.py Outdated
@@ -1440,7 +1485,8 @@ def apply_config(args, apySection):
(r'/identifyLang', IdentifyLangHandler),
(r'/getLocale', GetLocaleHandler),
(r'/pipedebug', PipeDebugHandler),
(r'/suggest', SuggestionHandler)
(r'/suggest', SuggestionHandler),
(r'/speller', SpellerHandler)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add comma at end

@sushain97
Copy link
Member

Can you merge in changes from master? I'd like to test this locally.

servlet.py Outdated

self.sendResponse(units)
else:
self.send_error(404, explanation="{} on spellchecker mode: {}".format('Error 404', 'Mode not installed'))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is kind of an awful error message. "Spelling mode kaz" not installed" e.g. would be far better.

@sushain97
Copy link
Member

Hm... something seems suspect.

[14718:14714 - 0:825] 10:27:38 [Sushain@Zircon.local:o +1] ~/Documents/apertium-html-tools
$ curl 'http://localhost:2737/speller?q=personas&lang=oci'
[]
[14718:14714 - 0:826] 10:27:59 [Sushain@Zircon.local:o +1] ~/Documents/apertium-html-tools
$ curl 'http://localhost:2737/speller?q=persoeeenas&lang=oci'
[]

@jonorthwash
Copy link
Member

@sushain97, is there a speller mode for oci?

@sushain97
Copy link
Member

sushain97 commented Jan 8, 2018 via email

@sushain97 sushain97 merged commit 4a8ef28 into apertium:master Jan 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants