-
Notifications
You must be signed in to change notification settings - Fork 303
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
Конина Анастасия #205
base: master
Are you sure you want to change the base?
Конина Анастасия #205
Conversation
TagCloud/Program.cs
Outdated
{ | ||
internal class Program | ||
{ | ||
public static void Main(string[] args) |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
TagCloud/Program.cs
Outdated
} | ||
} | ||
|
||
private static void DrawAndSaveCloud(List<Rectangle> rectangles, List<WordForCloud> wordsForCloud, |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
TagCloud/Program.cs
Outdated
wordsForCloud, outputFile, pictureSize); | ||
} | ||
|
||
private static List<string> GetWordsFromFile(string path) |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
using TagsCloudVisualization; | ||
|
||
[TestFixture] | ||
public class CircularCloudLayouter_Should |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
TagCloud/WordsNormalizer.cs
Outdated
|
||
public WordsNormalizer(HashSet<string> boringWords = null) | ||
{ | ||
this.boringWords = boringWords ?? new HashSet<string>(); |
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.
Все скучные слова: предлоги, междометья и прочее вручную вводить?
TagCloud/Program.cs
Outdated
{ | ||
using (var fileStream = new StreamReader(path)) | ||
{ | ||
return fileStream.ReadToEnd().Split('\n').ToList(); |
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.
Из базовых требований:
- поддерживать ввод данных из литературного текста, с приведением слов в начальную форму.
- дать возможность выбирать только определенные части речи (например, только существительные)
Сомневаюсь, что эта штука это учитывает
TagCloud/Program.cs
Outdated
{ | ||
public static void Main(string[] args) | ||
{ | ||
var inputFile = "1.txt"; |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
TagCloud/Program.cs
Outdated
|
||
var wordNormalizer = new WordsNormalizer(); | ||
var wordForCloudGenerator = new WordsForCloudGenerator("Arial", Color.Black, 60); | ||
var pictureSize = new Size(1000, 1000); |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
TagCloud/WordsForCloudGenerator.cs
Outdated
private static Dictionary<string, int> GetWordsFrequency(List<string> words) | ||
{ | ||
var wordFrequency = new Dictionary<string, int>(); | ||
foreach (var word in words) |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
TagCloud/WordsForCloudGenerator.cs
Outdated
return wordFrequency; | ||
} | ||
|
||
private static WordForCloud GetWordForCloud(string font, int maxWordSize, Color color, string word, |
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.
Вообще Tag это абстракция рисовальщика, он ее рисует, сам определяет ей размеры и тд, учитывая общий размер холста и проч, не очень понимаю, почему за нее знает штука, которая веса слов вычисляет
/// </exception> | ||
public IEnumerable<Point> GetPoints() | ||
{ | ||
double radius = 0; |
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.
var
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.
Проигнорированный коммент
public IEnumerable<Point> GetPoints() | ||
{ | ||
double radius = 0; | ||
var term = radiusStep / 360; |
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.
Что такое term? Кажется, нужно более понятное название переменной
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.
Проигнорированный коммент
TagCloud/ConsoleInterface.cs
Outdated
? boringWordsFileArg.ParsedValue | ||
: "boring.txt"; | ||
|
||
tagCloudSettings = new TagCloudSettings(pictureSize, |
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.
Удобнее пользоваться геттерами-сеттерами, чем километровыми конструкторами + там же можно указать значения по-умолчанию
TagCloud/ConsoleInterface.cs
Outdated
|
||
private static void CreateTagCloud(ITagCloudCreatorFactory tagCloudCreatorFactory, TagCloudSettings tagCloudSettings) | ||
{ | ||
var bitmap = GetCloudImage(tagCloudCreatorFactory, |
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.
Можно прокидывать класс настроек, а не значения по отдельности, смысла разворачивать обратно в отдельные переменные пока отсутствует, так как большинство прокидывается вглубь кода
return new List<string>(); | ||
using (var fileStream = new StreamReader(path)) | ||
{ | ||
return fileStream.ReadToEnd().Split('\n').ToList(); |
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.
А случай с \r\n?
|
||
public interface IWordsForCloudGeneratorFactory | ||
{ | ||
IWordsForCloudGenerator Get(string fontName, int maxFontSize, ITagCloudLayouter tagCloudLayouter, |
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.
В чем смысл этой абстракции? Реализация просто дергает конструктор
using TagsCloudVisualization; | ||
namespace TagCloud; | ||
|
||
public interface ITagCloudLayouterFactory |
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.
В данном случае все фактори будто бы бессмысленные
TagCloud/WordsForCloudGenerator.cs
Outdated
} | ||
|
||
private static Dictionary<string, int> GetWordsFrequency(List<string> words) => | ||
words.GroupBy(x => x) |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
namespace TagCloudTests; | ||
|
||
[TestFixture] | ||
public class WordsForCloudGenerator_Should |
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.
Тесты только на одну верхнеуровневую абстракцию
Нет тестов на детали реализаций, требования вроде приведения к нижнему регистру и другие
No description provided.