-
Notifications
You must be signed in to change notification settings - Fork 1
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
Now uses grammar endpoint on api.greynir.is. #19
base: master
Are you sure you want to change the base?
Conversation
…es not display progress
from datetime import datetime | ||
from typing import TYPE_CHECKING, Any, Dict, List, Optional, Pattern, Tuple, Union, cast |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, it is canonical to have imports from typing first in the import sequence...
|
||
app.register_blueprint(routes_blueprint) | ||
|
||
from routes import start_task_cleanup_thread |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, where did these go? It's not possible to delete them completely?
dirs: List[str] = list( | ||
map(os.path.dirname, [__file__, reynir.__file__, reynir_correct.__file__]) # type: ignore | ||
) | ||
dirs: List[str] = list(map(os.path.dirname, [__file__, reynir.__file__])) # type: ignore |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think type:ignore might no longer be needed - it's probably there because of an early bug in Pylance.
@@ -350,7 +313,4 @@ def resource_gone(e: BaseException) -> Tuple[Response, int]: | |||
) | |||
app.logger.info(log_str) # type: ignore | |||
|
|||
# Pre-load the correction engine into memory |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was there to make the first request response time a bit lower, while taking a tiny bit more time to initialize the server.
|
||
from correct import check_grammar, validate_token_and_nonce | ||
from doc import SUPPORTED_DOC_MIMETYPES, doc_class_for_mime_type | ||
from typing_extensions import Literal |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might be importable from typing now
Still synchronous and does not display progress. At the moment GreynirSeqAPI doesn't return the "details" for a given error so it is not displayed on the interface.
Things that are still left to do before merging: