-
Notifications
You must be signed in to change notification settings - Fork 32
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
Косторной Дмитрий #32
base: master
Are you sure you want to change the base?
Косторной Дмитрий #32
Conversation
…ену размера и цвета заднего фона
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.
Ревью
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.
Красивое
if (properties.AngleIncreasingStep == 0) | ||
throw new ArgumentException("AngleIncreasingStep should not be zero"); | ||
|
||
if (properties.RadiusIncreasingStep <= 0) |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
TagsCloudVisualization/Program.cs
Outdated
{ | ||
public static void Main(string[] args) | ||
{ | ||
Parser.Default.ParseArguments<CommandLineOptions>(args).WithParsed(commandLineOptions => |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
|
||
foreach (var paragraph in paragraphsOfText) | ||
{ | ||
var paragraphWords = Regex.Matches(paragraph, @"\b[a-zA-Zа-яА-Я]+\b") |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
|
||
public Color GetColor() | ||
{ | ||
if (_colorGetterProperties.ColorName == "random") |
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.
Можно завести какой-нибудь класс с константами (WellKnownColors) например, где будут хранится все известные названия кастомные названия цветов, и использовать его.
var imageFormatConverter = new ImageFormatConverter(); | ||
var imageFormat = imageFormatConverter.ConvertFromString(format); | ||
|
||
if (imageFormat == null) |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
TagsCloudVisualization/Program.cs
Outdated
{ | ||
foreach (var error in errors) | ||
{ | ||
Console.WriteLine(error.ToString()); |
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.
Сейчас можно не переделывать, но лучше не в консоль писать подобную инфу, а использовать какие-нибудь библиотеки для логирования, например эту - 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) |
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.
Возможно стоило подумать про то, чтобы высоту и ширину как-то автоматически вычислять в зависимости от размера текста. Что если я просто захочу закинуть в твою библиотеку полотно текста и не знаю на какого размера картинке облако тегов поместиться.
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.
This comment was marked as resolved.
Sorry, something went wrong.
} | ||
} | ||
|
||
return words |
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.
Еще вкину чисто на подумать. Слова могут иметь разную форму. "сделал" и "сделали" у тебя будут как 2 разных слова записаны. Возможно стоит приводить их к начальной форме. Есть например вот такая либа (для русского языка) - https://yandex.ru/dev/mystem/ . Ну или можно свои эвристики для этого какие-то придумать
No description provided.