-
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
Алешев Руслан #188
base: master
Are you sure you want to change the base?
Алешев Руслан #188
Conversation
@@ -0,0 +1,16 @@ | |||
<Project Sdk="Microsoft.NET.Sdk"> |
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.CLI | ||
{ | ||
public static class CommandLineArgs |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
public IEnumerable<(string, int)> GetAnalyzedText() | ||
{ | ||
foreach (KeyValuePair<string, int> pair in wordFrequency) | ||
{ | ||
yield return (pair.Key, pair.Value); | ||
} | ||
} |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
} | ||
} | ||
|
||
public void SaveToFile(string filePath) |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
public abstract void Analyze(string text); | ||
public abstract IEnumerable<(string, int)> GetAnalyzedText(); |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
foreach (var previous in Cloud) | ||
{ | ||
if (rectangle.IntersectsWith(previous)) | ||
return false; | ||
} | ||
|
||
return true; |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
|
||
namespace TagsCloudVisualization | ||
{ | ||
public class TagsCloudLayouter |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
|
||
private readonly Graphics graphics; | ||
private readonly Image image; | ||
public ICollection<Rectangle> Cloud { get; private set; } |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
foreach (var word in words) | ||
{ | ||
var font = new Font(drawingSettings.FontFamily, drawingSettings.FontSize + word.Item2); | ||
var size = (graphics.MeasureString(word.Item1, font) + new SizeF(1, 0)).ToSize(); ; |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
var rect = PutNextRectangle(textImage.Size); | ||
Cloud.Add(rect); | ||
|
||
graphics.DrawString(textImage.Text, textImage.Font, brush, rect); |
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.
…ider Случайное нормальное распределение.
return !Cloud.Any(x => x.IntersectsWith(rectangle)); | ||
} | ||
|
||
internal Rectangle PutNextRectangle(Size rectangleSize) |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
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.
Раньше на него был тест, вернул в private
{ | ||
public interface ITextReader | ||
{ | ||
public abstract string ReadText(string filePath); |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
{ | ||
public class FrequencyAnalyzer : IAnalyzer | ||
{ | ||
//private readonly TextPreprocessing preprocessor; |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
Rectangle rectangle; | ||
bool placingIsCorrect; | ||
|
||
var enumerator = pointsProvider.Points().GetEnumerator(); |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
init: начальная структура программы