-
Notifications
You must be signed in to change notification settings - Fork 229
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
Бочаров Александр #185
base: master
Are you sure you want to change the base?
Бочаров Александр #185
Conversation
? ReadFromExistingFile(path) | ||
: Result.Fail<List<string>>("No file found"); | ||
|
||
public abstract Result<List<string>> ReadFromExistingFile(string path); |
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.
можно сделать protected
|
||
namespace TagCloud.WordsReader.Readers; | ||
|
||
public abstract class BaseFileReader(string path) : IWordsReader |
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.
Нет необходимости в двух абстракциях (и интерфейс, и абстрактный класс)
@@ -18,7 +19,7 @@ public CsvFileReader(CsvFileReaderSettings settings) | |||
: this(settings.FilePath, settings.Culture) |
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.
Word можно сделать init
public Result<List<string>> ReadWords() | ||
=> File.Exists(path) | ||
? ReadFromExistingFile(path) | ||
: Result.Fail<List<string>>("No file found"); |
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.
В ридерах обрабатывается только 1 одна ошибка (не найден файл), но явно могут возникнуть и другие. Давай их тоже обработаем
@@ -10,8 +11,8 @@ public class CircularCloudLayouter(Point layoutCenter, IPointsGenerator pointsGe | |||
private const string FiniteGeneratorExceptionMessage = |
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.
А почему текст решил вынести в константу? Смущает что текст ошибки только в одном месте константа, во всех остальных нет, хочется придерживаться одного подхода во всей задаче
"./Dictionaries/enUS.aff"); | ||
private const string EnglishDic = "./Dictionaries/enUS.dic"; | ||
private const string EnglishAff = "./Dictionaries/enUS.aff"; | ||
public Result<List<string>> ApplyFilter(List<string> 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.
А почему не IEnumerable? Если сделать IEnumerable, то можно не делать приведения к List как в строке 14
No description provided.