...
|
...
|
@@ -55,7 +55,7 @@ public class BaikeSpiderService { |
|
|
String baikeDir = BaikeSpiderService.class.getResource("/baike").getPath();
|
|
|
File baikeDirFile = new File(baikeDir);
|
|
|
if (!baikeDirFile.exists() || !baikeDirFile.isDirectory()) {
|
|
|
throw new RuntimeException("Cannot find baike directory.");
|
|
|
throw new RuntimeException("Cannot find baike directory. baikeDir=" + baikeDir);
|
|
|
}
|
|
|
|
|
|
File[] baikeUrlFiles = baikeDirFile.listFiles((file, fileName) -> fileName.endsWith(".txt"));
|
...
|
...
|
@@ -90,7 +90,7 @@ public class BaikeSpiderService { |
|
|
return result;
|
|
|
}
|
|
|
|
|
|
private Set<String> getAllYohoKeywords(){
|
|
|
private Set<String> getAllYohoKeywords() {
|
|
|
Set<String> resultSet = new HashSet<>(2000);
|
|
|
List<Brand> brandList = brandService.getBrandPageLists(1, Integer.MAX_VALUE);
|
|
|
resultSet.addAll(brandList.stream().map(Brand::getBrandName).filter(name -> StringUtils.isNotBlank(name)).collect(Collectors.toSet()));
|
...
|
...
|
@@ -108,5 +108,4 @@ public class BaikeSpiderService { |
|
|
|
|
|
return resultSet;
|
|
|
}
|
|
|
|
|
|
} |
...
|
...
|
|