You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
646 B
22 lines
646 B
package com.rental.crawler.strategy;
|
|
|
|
public class PublisherAnalysisStrategy implements AnalysisStrategy {
|
|
@Override
|
|
public String getStrategyName() {
|
|
return "PublisherAnalysis";
|
|
}
|
|
|
|
@Override
|
|
public boolean analyze(String input) {
|
|
if (input == null || input.isEmpty()) {
|
|
return false;
|
|
}
|
|
String[] validPublishers = {"人民文学出版社", "上海译文出版社", "作家出版社", "译林出版社"};
|
|
for (String publisher : validPublishers) {
|
|
if (input.contains(publisher)) {
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
}
|