|
@@ -13,7 +13,6 @@ import com.tzld.longarticle.recommend.server.service.score.strategy.SimilaritySt
|
|
|
import com.tzld.longarticle.recommend.server.service.score.strategy.ViewCountStrategy;
|
|
|
import com.tzld.longarticle.recommend.server.util.CommonCollectionUtils;
|
|
|
import com.tzld.longarticle.recommend.server.util.JSONUtils;
|
|
|
-import com.tzld.longarticle.recommend.server.util.TitleSimilarCheckUtil;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.collections4.CollectionUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -81,24 +80,4 @@ public class RankV2Strategy implements RankStrategy {
|
|
|
return scoreParam;
|
|
|
}
|
|
|
|
|
|
- private List<Content> deduplication(List<Content> contents) {
|
|
|
- List<String> titles = new ArrayList<>();
|
|
|
- List<Content> result = new ArrayList<>();
|
|
|
- // 遍历所有列表
|
|
|
- for (Content c : contents) {
|
|
|
- if (similarity(c.getTitle(), titles)) {
|
|
|
- continue;
|
|
|
- } else {
|
|
|
- result.add(c);
|
|
|
- titles.add(c.getTitle());
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- return result;
|
|
|
- }
|
|
|
-
|
|
|
- private boolean similarity(String title, List<String> titles) {
|
|
|
- return TitleSimilarCheckUtil.isDuplicateContent(title, titles);
|
|
|
- }
|
|
|
-
|
|
|
}
|