at_least_1_authors_repeat = 0 说明此文章的作者从未写过别的文章。
at_least_2_authors_repeat = 0 说明该文章的作者们除此文章之外从未有过任何的两两合作。
。。。。
其中的逻辑或许是找出其他题目中的作者和该题目作者的最大相似程度。
京剧
- data test;
- length Title $20. Authors $200.;
- input Title Authors & Number_authors ;
- cards;
- Title1 Name A|Name B 2
- Title2 Name B|Name C 2
- Title3 Name C|Name D|Name B 3
- Title4 Name D|Name E 2
- Title5 Name B|Name C|Name D 3
- Title6 Name F|Name G|Name H|Name I|Name J|Name K 6
- Title7 Name A|Name B|Name C|Name D|Name E|Name F 6
- Title8 Name A|Name B|Name C|Name D|Name E|Name F 6
- Title9 Name U 1
- ;
- data test2;
- set test;
- array t[200] $64. _temporary_;
- call missing(of t[*]);
- do i =1 to Number_authors;
- t[i] =scan(authors, i, '|');
- end;
- k =0;
- do i =1 to nobs;
- set test(keep=authors rename=(authors=authors1)) point=i nobs=nobs;
- if _n_ ^=i then do j =1 to Number_authors;
- if not missing(t[j]) then if find(authors1, cats(t[j])) then s ++1;
- end;
- k =max(k, s);
- s =0;
- end;
- array f[5] at_least_1_authors_repeat at_least_2_authors_repeat at_least_3_authors_repeat
- at_least_4_authors_repeat at_least_5_authors_repeat;
- do i =1 to dim(f);
- f[i] =0;
- if i <=k then f[i] =1;
- end;
- drop k j s authors1;
- run;