-
Notifications
You must be signed in to change notification settings - Fork 11
Hard/soft config experiments #46
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
base: master
Are you sure you want to change the base?
Conversation
…ultipleListsPredicates,multipleListsPredicatesWithDocument in ListRule.kt and ListRuleBuilder.kt
| val hardConfigurationWords: MutableList<String> = mutableListOf() | ||
| File(fileConfigurationWordsName).forEachLine { hardConfigurationWords.add(it) } | ||
|
|
||
| lines.forEach { line -> line.text.forEach { |
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.
It is preferred to use functional approach
Suggestion: use map, filter and reduce instead of for loop
| } | ||
| } | ||
|
|
||
| if (wordCount < precisionWordCount) |
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.
It is preferred to use explicit return statements
| if (word!="Заключение") | ||
| linesIndexes.first <= it.documentIndex && it.documentIndex < linesIndexes.second | ||
| else linesIndexes.first <= it.documentIndex | ||
| }.toMutableList() |
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.
It is preferred to use "toList" if list isn't supposed to be modified
| linesFilters.forEach { lines = it(lines, document) } | ||
|
|
||
| if (lines.isNotEmpty()) { | ||
| singleLinePredicates.forEach { predicate -> |
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.
It is preferred to use a single add method by using functional approach with map, reduce, filter and flatten instead of forEach
| type, | ||
| region, | ||
| name) | ||
| } No newline at end of file |
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.