Skip to content

Commit 08d25f6

Browse files
committed
improve: extract a quantity from blocks when they are abbreviated.
Fix #1298
1 parent e45f67c commit 08d25f6

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
@@ -61,7 +61,7 @@ public class SeriesInfoExtractorServiceImpl implements SeriesInfoExtractorServic
6161
// Regular expression matches number of the stamps in a series (from 1 to 999).
6262
// CheckStyle: ignore LineLength for next 2 lines
6363
private static final Pattern NUMBER_OF_STAMPS_REGEXP = Pattern.compile(
64-
"(?<quantity>[1-9][0-9]{0,2})(-?(ти|ой|ух))?( ((без)?зубцов(ая|ы[ех])))? (мар(ок|к[аи])|блок(а|ов)?)",
64+
"(?<quantity>[1-9][0-9]{0,2})(-?(ти|ой|ух))?( ((без)?зубцов(ая|ы[ех])))? (мар(ок|к[аи])|блок(а|ов)?|БЛ)",
6565
Pattern.CASE_INSENSITIVE | Pattern.UNICODE_CASE
6666
);
6767

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
@@ -413,6 +413,7 @@ class SeriesInfoExtractorServiceImplTest extends Specification {
413413
'1 блок' || 1
414414
'4 блока' || 4
415415
'6 блоков' || 6
416+
'6 БЛ' || 6
416417
'6 зубцовых блоков' || 6
417418
'серия из 5-ти марок' || 5
418419
'серия из 21-ой марки' || 21

0 commit comments

Comments
 (0)