Skip to content

Commit 00f1b4c

Browse files
committed
Series import: improve parsing of non-perforated flag and quantity.
Fix #820
1 parent 242d5ed commit 00f1b4c

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/main/java/ru/mystamps/web/service/SeriesInfoExtractorServiceImpl.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,10 @@ public class SeriesInfoExtractorServiceImpl implements SeriesInfoExtractorServic
4646
Pattern.compile("18[4-9][0-9]|19[0-9]{2}|20[0-9]{2}");
4747

4848
// Regular expression matches number of the stamps in a series (from 1 to 99).
49-
private static final Pattern NUMBER_OF_STAMPS_REGEXP =
50-
Pattern.compile("([1-9][0-9]?) марок");
49+
private static final Pattern NUMBER_OF_STAMPS_REGEXP = Pattern.compile(
50+
"([1-9][0-9]?)( беззубцовые)? мар(ок|ки)",
51+
Pattern.CASE_INSENSITIVE | Pattern.UNICODE_CASE
52+
);
5153

5254
private final Logger log;
5355
private final CategoryService categoryService;
@@ -196,7 +198,8 @@ protected Boolean extractPerforated(String fragment) {
196198

197199
log.debug("Determining perforation from a fragment: '{}'", fragment);
198200

199-
boolean withoutPerforation = StringUtils.contains(fragment, "б/з");
201+
boolean withoutPerforation = StringUtils.contains(fragment, "б/з")
202+
|| StringUtils.containsIgnoreCase(fragment, "беззубцовые");
200203
if (withoutPerforation) {
201204
log.debug("Perforation is false");
202205
return Boolean.FALSE;

0 commit comments

Comments
 (0)