Skip to content
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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

anastasiakimura
Copy link

No description provided.

{
internal class Program
{
public static void Main(string[] args)

This comment was marked as resolved.

}
}

private static void DrawAndSaveCloud(List<Rectangle> rectangles, List<WordForCloud> wordsForCloud,

This comment was marked as resolved.

wordsForCloud, outputFile, pictureSize);
}

private static List<string> GetWordsFromFile(string path)

This comment was marked as resolved.

using TagsCloudVisualization;

[TestFixture]
public class CircularCloudLayouter_Should

This comment was marked as resolved.

This comment was marked as resolved.


public WordsNormalizer(HashSet<string> boringWords = null)
{
this.boringWords = boringWords ?? new HashSet<string>();
Copy link

Choose a reason for hiding this comment

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

Все скучные слова: предлоги, междометья и прочее вручную вводить?

{
using (var fileStream = new StreamReader(path))
{
return fileStream.ReadToEnd().Split('\n').ToList();
Copy link

Choose a reason for hiding this comment

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

Из базовых требований:

  • поддерживать ввод данных из литературного текста, с приведением слов в начальную форму.
  • дать возможность выбирать только определенные части речи (например, только существительные)

Сомневаюсь, что эта штука это учитывает

{
public static void Main(string[] args)
{
var inputFile = "1.txt";

This comment was marked as resolved.


var wordNormalizer = new WordsNormalizer();
var wordForCloudGenerator = new WordsForCloudGenerator("Arial", Color.Black, 60);
var pictureSize = new Size(1000, 1000);

This comment was marked as resolved.

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.

return wordFrequency;
}

private static WordForCloud GetWordForCloud(string font, int maxWordSize, Color color, string word,
Copy link

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;
Copy link

Choose a reason for hiding this comment

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

var

Copy link

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;
Copy link

Choose a reason for hiding this comment

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

Что такое term? Кажется, нужно более понятное название переменной

Copy link

Choose a reason for hiding this comment

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

Проигнорированный коммент

? boringWordsFileArg.ParsedValue
: "boring.txt";

tagCloudSettings = new TagCloudSettings(pictureSize,
Copy link

Choose a reason for hiding this comment

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

Удобнее пользоваться геттерами-сеттерами, чем километровыми конструкторами + там же можно указать значения по-умолчанию


private static void CreateTagCloud(ITagCloudCreatorFactory tagCloudCreatorFactory, TagCloudSettings tagCloudSettings)
{
var bitmap = GetCloudImage(tagCloudCreatorFactory,
Copy link

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();
Copy link

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,
Copy link

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
Copy link

Choose a reason for hiding this comment

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

В данном случае все фактори будто бы бессмысленные

}

private static Dictionary<string, int> GetWordsFrequency(List<string> words) =>
words.GroupBy(x => x)

This comment was marked as resolved.

namespace TagCloudTests;

[TestFixture]
public class WordsForCloudGenerator_Should
Copy link

Choose a reason for hiding this comment

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

Тесты только на одну верхнеуровневую абстракцию

Нет тестов на детали реализаций, требования вроде приведения к нижнему регистру и другие

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