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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

code refactored with some func variable name update #78

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

R1j1t
Copy link
Owner

@R1j1t R1j1t commented Aug 20, 2022

Description

  1. Planned naming convention updates:
  • function name
  • variable name
  • spacy extentions name
  1. Code Refactor:
  • Split functions to handle small tasks
  • Update in-code documentation
  • Remove dead code
  • remove useless comments
  • Divide main class into helper code ?
  • Incorporate pylint suggestions
  • pass all test (obviously 馃挴 )
  • Update user documentation

Checklist

  • Added and/or updated the test (not required for documentation changes)
  • My changes don't require a change to the documentation, or if they do, I've added all required information

@R1j1t R1j1t marked this pull request as draft August 21, 2022 06:15
@stale
Copy link

stale bot commented Sep 20, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the wontfix This will not be worked on label Sep 20, 2022
@R1j1t R1j1t added documentation Improvements or additions to documentation and removed wontfix This will not be worked on labels Sep 20, 2022
import spacy
from .contextualSpellCheck import ContextualSpellCheck

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):

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:

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:

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 = ""):

Choose a reason for hiding this comment

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

Return type annotations

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants