-
-
Notifications
You must be signed in to change notification settings - Fork 37
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
Sourcery refactored refactor-generate-features-module branch #30
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,7 +38,7 @@ def sentiment_polarity(score: float) -> str: | |
|
||
score = float(score) | ||
score = (score + 1) / 2 # see https://stats.stackexchange.com/questions/70801/how-to-normalize-data-to-0-1-range | ||
score = score * 100 | ||
score *= 100 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Function
|
||
for _, each_slab in enumerate(sentiment_polarity_to_words_mapping): # pragma: no cover | ||
# pragma: no cover => early termination leads to loss of test coverage info | ||
if (score >= each_slab[1]) and (score <= each_slab[2]): | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,9 +15,8 @@ def gather_stop_words(text: str) -> list: | |
return [] | ||
|
||
word_tokens = word_tokenize(text) | ||
found_stop_words = [word for _, word in enumerate(word_tokens) | ||
return [word for _, word in enumerate(word_tokens) | ||
if word in STOP_WORDS] | ||
return found_stop_words | ||
Comment on lines
-18
to
-20
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Function
|
||
|
||
|
||
def count_stop_words(text: str) -> int: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -68,6 +68,6 @@ def generate_data() -> list: | |
text_with_punctuations, text_with_a_date, text_with_dates, text_with_duplicates] | ||
|
||
new_data = [] | ||
for index in range(1): | ||
for _ in range(1): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Function
|
||
new_data.extend(data) | ||
return new_data |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -68,6 +68,6 @@ def generate_data() -> list: | |
text_with_punctuations, text_with_a_date, text_with_dates, text_with_duplicates] | ||
|
||
new_data = [] | ||
for index in range(1): | ||
for _ in range(1): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Function
|
||
new_data.extend(data) | ||
return new_data |
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
gather_whole_numbers
refactored with the following changes:inline-immediately-returned-variable
)