Skip to content

Commit 4c4676d

Browse files
committed
fix(series import): correctly determine quantity when number of blocks matches [2-9]?[234] and it's written in Russian.
Fix #1227
1 parent 65a487b commit 4c4676d

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/main/java/ru/mystamps/web/feature/series/importing/SeriesInfoExtractorServiceImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public class SeriesInfoExtractorServiceImpl implements SeriesInfoExtractorServic
5656

5757
// Regular expression matches number of the stamps in a series (from 1 to 99).
5858
private static final Pattern NUMBER_OF_STAMPS_REGEXP = Pattern.compile(
59-
"(?<quantity>[1-9][0-9]?)( (беззубцовые|зубцовых))? (мар(ок|ки)|блоков)",
59+
"(?<quantity>[1-9][0-9]?)( (беззубцовые|зубцовых))? (мар(ок|ки)|блок(а|ов))",
6060
Pattern.CASE_INSENSITIVE | Pattern.UNICODE_CASE
6161
);
6262

src/test/groovy/ru/mystamps/web/feature/series/importing/SeriesInfoExtractorServiceImplTest.groovy

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,7 @@ class SeriesInfoExtractorServiceImplTest extends Specification {
394394
'13 беззубцовые марок' || 13
395395
'4 беззубцовые марки' || 4
396396
'32 БЕЗЗУБЦОВЫЕ МАРКИ' || 32
397+
'4 блока' || 4
397398
'6 блоков' || 6
398399
'6 зубцовых блоков' || 6
399400
}

0 commit comments

Comments
 (0)