Skip to content

Косторной Дмитрий#32

Open
Kostornoj-Dmitrij wants to merge 32 commits intokontur-courses:masterfrom
Kostornoj-Dmitrij:master
Open

Косторной Дмитрий#32
Kostornoj-Dmitrij wants to merge 32 commits intokontur-courses:masterfrom
Kostornoj-Dmitrij:master

Conversation

@Kostornoj-Dmitrij
Copy link
Copy Markdown

No description provided.

Copy link
Copy Markdown

@PeterMotorniy PeterMotorniy left a comment

Choose a reason for hiding this comment

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

Ревью

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 (properties.AngleIncreasingStep == 0)
throw new ArgumentException("AngleIncreasingStep should not be zero");

if (properties.RadiusIncreasingStep <= 0)

This comment was marked as resolved.

{
public static void Main(string[] args)
{
Parser.Default.ParseArguments<CommandLineOptions>(args).WithParsed(commandLineOptions =>

This comment was marked as resolved.


foreach (var paragraph in paragraphsOfText)
{
var paragraphWords = Regex.Matches(paragraph, @"\b[a-zA-Zа-яА-Я]+\b")

This comment was marked as resolved.


public Color GetColor()
{
if (_colorGetterProperties.ColorName == "random")
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Можно завести какой-нибудь класс с константами (WellKnownColors) например, где будут хранится все известные названия кастомные названия цветов, и использовать его.

var imageFormatConverter = new ImageFormatConverter();
var imageFormat = imageFormatConverter.ConvertFromString(format);

if (imageFormat == null)

This comment was marked as resolved.

{
foreach (var error in errors)
{
Console.WriteLine(error.ToString());
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Сейчас можно не переделывать, но лучше не в консоль писать подобную инфу, а использовать какие-нибудь библиотеки для логирования, например эту - https://learn.microsoft.com/en-us/dotnet/core/extensions/logging?tabs=command-line
Так будет проще код переделать, если у нас приложение например будет хостится на удаленном сервере и мы захотим логи писать не в консоль, а в файл или еще куда-нибудь.

public int Height { get; }
public Color BackgroundColor { get; }

public ImageProperties(int width, int height, string colorName)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Возможно стоило подумать про то, чтобы высоту и ширину как-то автоматически вычислять в зависимости от размера текста. Что если я просто захочу закинуть в твою библиотеку полотно текста и не знаю на какого размера картинке облако тегов поместиться.

HelpText = "Delta angle for the spiral")]
public double AngleIncreasingStep { get; set; }

[Option("radiusIncreasingStep", Default = 1, HelpText = "Delta radius for the spiral")]

This comment was marked as resolved.

}
}

return words
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Еще вкину чисто на подумать. Слова могут иметь разную форму. "сделал" и "сделали" у тебя будут как 2 разных слова записаны. Возможно стоит приводить их к начальной форме. Есть например вот такая либа (для русского языка) - https://yandex.ru/dev/mystem/ . Ну или можно свои эвристики для этого какие-то придумать

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