-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
158 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
from argparse import Namespace | ||
tags = {'br': '<br>', 'close_div': '</div>', 'div_class': '<div class="format_description">'} | ||
tag = Namespace(**tags) | ||
|
||
def format_descriptions(desc_list, open_tag = '', close_tag = ''): | ||
return list(map(lambda item: f"{open_tag}{item}{close_tag}", desc_list)) | ||
|
||
def format_header(header, close_tag = ''): | ||
return f"{header}{close_tag}" | ||
|
||
def find_tasks_on_slides_feedback(slides_with_tasks): | ||
return format_header('Всего задач: {}'.format(slides_with_tasks.get('count')), tag.br), \ | ||
'Распознанные задачи: ', \ | ||
*format_descriptions(slides_with_tasks.get('recognized'), tag.div_class, tag.br + tag.close_div), \ | ||
'Не найдены: ', \ | ||
*format_descriptions(slides_with_tasks.get('not_found'), tag.div_class, tag.br + tag.close_div) | ||
|
||
def tasks_conclusions_feedback(results): | ||
return format_header('Соответствует на {}%'.format(results[0]), tag.br), \ | ||
'Распознанные заключения: ', \ | ||
*format_descriptions(results[2], tag.div_class, tag.br + tag.close_div) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters