Skip to content

Медников Матвей#43

Open
easyThingsLover wants to merge 8 commits intokontur-courses:masterfrom
easyThingsLover:master
Open

Медников Матвей#43
easyThingsLover wants to merge 8 commits intokontur-courses:masterfrom
easyThingsLover:master

Conversation

@easyThingsLover
Copy link
Copy Markdown

No description provided.

private const int minContentWordLength = 4;
private const int minWordsCount = 2;

public Dictionary<string, int> Filter(Dictionary<string, int> rawCounts, int totalWords)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Добавь возможность отфильтровать слова по "черному списку". Давай черный список не хардкодить, а читать из файла

if (string.IsNullOrWhiteSpace(name))
return spiral;

return name.ToLowerInvariant() switch
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Нехорошо. Избавься от свича и завязки на конкретные строки - код становится хрупким. "Запрещено использовать операторы if, switch, ?: и прочие условные операторы, если их можно заменить полиморфизмом."


public static class Program
{
public static void Main(string[] args)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Нет общего интерфейса для "запуска генерации", нет слоя, изолированного от ввода-вывода. "Организуй код так, чтобы было легко сделать оба вида клиентов — и клиента командной строки, и GUI приложение с вводом параметров и интерактивным просмотром"


foreach (var ch in trimmed)
{
if (!char.IsLetter(ch))
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Как быть со словами типа "can't", "co-owner" и т.д.?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants