Skip to content

Commit d6ec030

Browse files
committedJan 18, 2020
fix(series import): correctly determine quantity when number of stamps is matches [2-9]?1 and it's written in Russian.
·
0.4.70.4.3
1 parent 4c4676d commit d6ec030

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-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: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -388,12 +388,15 @@ class SeriesInfoExtractorServiceImplTest extends Specification {
388388
service.extractQuantity(fragment) == expectedQuantity
389389
where:
390390
fragment || expectedQuantity
391+
'1 марка' || 1
391392
'5 марок' || 5
392393
'5 МАРОК' || 5
393394
'22 марки' || 22
394395
'13 беззубцовые марок' || 13
396+
'1 беззубцовая марка' || 1
395397
'4 беззубцовые марки' || 4
396398
'32 БЕЗЗУБЦОВЫЕ МАРКИ' || 32
399+
'1 блок' || 1
397400
'4 блока' || 4
398401
'6 блоков' || 6
399402
'6 зубцовых блоков' || 6

0 commit comments

Comments
 (0)
Please sign in to comment.