-
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
Овечкин Илья #193
base: master
Are you sure you want to change the base?
Овечкин Илья #193
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.
Пробежимся по критериям
Обязательные пункты:
Исходный текст:
✅ Источником данных должен быть файл со словами по одному в строке.
Предобработка слов:
✅ На этапе предобработки, приведи все слова к нижнему регистру и исключи скучные слова
Формат результата:
✅ В качестве результата программа должна генерировать png-файл.
✅ Должна быть возможность задать цвета, шрифт и размер изображения.
Алгоритм
✅ Сделай так, чтобы по одному тексту можно было сгенерировать несколько облаков тегов с помощью разных алгоритмов или одного алгоритма с разными настройками.
GUI или Console:
✅ Организуй код так, чтобы было легко сделать оба вида клиентов — и клиента командной строки, и GUI приложение с вводом параметров и интерактивным просмотром. (оставил комментарий в коде, пункт близится к закрытию)
✅ Реализуй одного клиента по выбору
Пункты на перспективу:
Предобработка слов:
✅ дать возможность влиять на список скучных слов, которые не попадут в облако.
Формат результата:
✅ поддерживать разные форматы изображений.
this.tagCloudClient = tagCloudClient; | ||
} | ||
|
||
public string Category => "���������"; |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
var wordFrequencies = new Dictionary<string, int>(); | ||
var interestingWords = GetInterestingWords(sourceFilePath, boringFilePath); | ||
|
||
for (int i = 0; i < interestingWords.Count; i++) |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
<ItemGroup> | ||
<PackageReference Include="FluentAssertions" Version="6.12.0" /> | ||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" /> | ||
<PackageReference Include="NUnit" Version="4.0.1" /> |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
|
||
namespace TagsCloudContainer.Actions | ||
{ | ||
public class TagCloudClient : ITagCloudClient |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
var dialog = new SaveFileDialog | ||
{ | ||
CheckFileExists = false, | ||
InitialDirectory = Path.GetFullPath(filePath), | ||
DefaultExt = "png", | ||
FileName = "image.png", | ||
Filter = "����������� (*.png)|*.png|����������� (*.jpg)|*.jpg|����������� (*.bmp)|*.bmp" | ||
}; | ||
var res = dialog.ShowDialog(); |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
{ | ||
get => sourceFilePath; | ||
set => sourceFilePath = File.Exists(value) ? value : sourceFilePath; | ||
} |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
set => boringFilePath = File.Exists(value) ? value : boringFilePath; | ||
} | ||
|
||
public static string GetProjectDirectory() |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Windows.Forms; |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
return new ToolStripMenuItem(name, null, menuItems); | ||
} | ||
|
||
public static ToolStripItem ToMenuItem(this IUiAction action) |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
TagsCloudContainer/Program.cs
Outdated
builder.RegisterType<MainForm>().As<Form>(); | ||
builder.RegisterType<ImageSettings>().AsSelf().SingleInstance(); | ||
builder.RegisterType<FileSettings>().AsSelf().SingleInstance(); | ||
builder.RegisterType<AlgorithmSettings>().AsSelf().SingleInstance(); | ||
builder.RegisterType<PictureBox>().AsSelf().SingleInstance(); | ||
builder.RegisterType<FileParser>().As<IFileParser>(); | ||
builder.RegisterType<WordProcessor>().As<IWordProcessor>(); | ||
builder.RegisterType<CircularCloudLayouter>().As<ICloudLayouter>(); | ||
builder.RegisterType<TagCloudDrawer>().As<IDrawer>(); | ||
builder.RegisterType<SelectBoringWordsFileAction>().As<IUiAction>(); | ||
builder.RegisterType<SelectSourceFileAction>().As<IUiAction>(); | ||
builder.RegisterType<SaveImageAction>().As<IUiAction>(); | ||
builder.RegisterType<AlgorithmSettingsAction>().As<IUiAction>(); | ||
builder.RegisterType<ImageSettingsAction>().As<IUiAction>(); | ||
builder.RegisterType<DrawTagCloudAction>().As<IUiAction>(); | ||
builder.RegisterType<TagCloudClient>().As<ITagCloudClient>(); | ||
builder.RegisterType<RectanglePlacer>().As<IRectanglePlacer>(); |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
|
||
public static ContainerBuilder CreateBuilder() | ||
{ | ||
var builder = new ContainerBuilder(); |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
{ | ||
var algSettings = new AlgorithmSettings(); | ||
var imgSettings = new ImageSettings(); | ||
layouter = new CircularCloudLayouter(algSettings, imgSettings); |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
@elybelyaev