[Library|Trunk]
Result landing: SEO fix: improve spam filter for authors (names that include 'nn') git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@61000 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
parent
b3ea315393
commit
b9af858885
|
@ -671,7 +671,7 @@ export class ResultLandingComponent {
|
||||||
let common_authors = ["[s.n.]","null &na;","nn","(:unap)","(:null)","null anonymous","anonymous"];
|
let common_authors = ["[s.n.]","null &na;","nn","(:unap)","(:null)","null anonymous","anonymous"];
|
||||||
allow = allow && !(
|
allow = allow && !(
|
||||||
this.isKeyword(this.resultLandingInfo.title,common_titles) || this.isKeyword(this.resultLandingInfo.description,common_abstract) ||
|
this.isKeyword(this.resultLandingInfo.title,common_titles) || this.isKeyword(this.resultLandingInfo.description,common_abstract) ||
|
||||||
(this.resultLandingInfo.authors && this.hasKeyword(this.resultLandingInfo.authors.map(o => o.fullName).join(" "),common_authors))
|
(this.resultLandingInfo.authors && this.hasKeyword("_"+this.resultLandingInfo.authors.map(o => o.fullName).join("_")+"_",common_authors, "_"))
|
||||||
);
|
);
|
||||||
// console.log("common content " + allow)
|
// console.log("common content " + allow)
|
||||||
if(!allow) {
|
if(!allow) {
|
||||||
|
@ -683,8 +683,8 @@ export class ResultLandingComponent {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private hasKeyword(value:string, words:string[]){
|
private hasKeyword(value:string, words:string[], wordSuffix = ""){
|
||||||
return value?words.filter( word => { return value.toLowerCase().indexOf(word)!=-1}).length > 0:0;
|
return value?words.filter( word => { return value.toLowerCase().indexOf(wordSuffix + word + wordSuffix)!=-1}).length > 0:0;
|
||||||
}
|
}
|
||||||
private isKeyword(value:string, words:string[]){
|
private isKeyword(value:string, words:string[]){
|
||||||
return value?words.filter( word => { return value.toLowerCase() == word}).length > 0:0;
|
return value?words.filter( word => { return value.toLowerCase() == word}).length > 0:0;
|
||||||
|
|
Loading…
Reference in New Issue