-
Notifications
You must be signed in to change notification settings - Fork 48
Laboratory work #4, Tatiana Zheleznova - 22FPL2 #181
Conversation
…исправила стиль кода.
…исправила стиль кода и все ошибки mypy.
…исправила стиль кода и все ошибки mypy.
…исправила стиль кода и все ошибки mypy.
…исправила стиль кода и все ошибки mypy. Надеюсь, убрала ошибку в start.py.
…исправила стиль кода и все ошибки mypy.
lab_4_fill_words_by_ngrams/main.py
Outdated
clean_text = '' | ||
for symbol in new_text.lower(): | ||
if symbol.isalpha or symbol.isspace() or symbol == self._end_of_word_token: | ||
clean_text += symbol |
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.
string concatination is a bad way
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 agree, Artyom from the Past
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.
fixed, both Artyoms
lab_4_fill_words_by_ngrams/main.py
Outdated
@@ -56,6 +74,10 @@ def _postprocess_decoded_text(self, decoded_corpus: tuple[str, ...]) -> str: # | |||
Raises: | |||
ValueError: In case of inappropriate type input argument or if input argument is empty. | |||
""" | |||
if not isinstance(decoded_corpus, tuple) or not decoded_corpus: | |||
return ValueError | |||
decoded_text = ' '.join(decoded_corpus).replace(self._end_of_word_token, '.').capitalize() |
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.
split into 2 lines, please
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.
fixed
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.
What about start.py?
lab_4_fill_words_by_ngrams/main.py
Outdated
clean_text = '' | ||
for symbol in new_text.lower(): | ||
if symbol.isalpha or symbol.isspace() or symbol == self._end_of_word_token: | ||
clean_text += symbol |
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 agree, Artyom from the Past
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.
Where is start.py?
Well done! Good job! |
Here we go again