-
Notifications
You must be signed in to change notification settings - Fork 64
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
code refactored with some func variable name update #78
base: master
Are you sure you want to change the base?
Conversation
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
import spacy | ||
from .contextualSpellCheck import ContextualSpellCheck |
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 is no longer works. please write the full path of the import
|
||
__all__ = ["ContextualSpellCheck", "add_to_pipe"] | ||
|
||
|
||
def add_to_pipe(nlp, **kwargs): | ||
def add_to_pipe(nlp: spacy.language.Language, **kwargs): |
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.
Annotations for return type are missing.
|
||
try: | ||
# First open() for user specified word addition to vocab | ||
with open(vocab_path, encoding="utf8") as vocab_file_buffer: |
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.
You are using utf8
too many time. maybe its better to make it as const param like this.
FORMAT_UTF8 = 'utf8'
@@ -439,14 +430,31 @@ def time_log(fn_name, relative_time): | |||
print(fn_name, "took: ", time_now - relative_time) | |||
return datetime.now() | |||
|
|||
@deprecate("has_spelling_correction") | |||
def token_require_spell_check(self, token) -> bool: |
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.
Function is getting token without annotations.
from functools import wraps | ||
|
||
|
||
def deprecate(new_function_name: str = ""): |
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.
Return type annotations
Description
Improve code readability, improve func/var naming conventions inline with Improve general code quality for maintenance purposes #25
Checklist