-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Leverage departmental affiliation string matching for phase two matching #79
Labels
Comments
michaelbales1
changed the title
Use "Department of [target author's department(s) as tracked in rc_identity]" to match target co-authors
Leverage departmental affiliation string matching for phase 2 matching
Jun 5, 2015
michaelbales1
changed the title
Leverage departmental affiliation string matching for phase 2 matching
Leverage departmental affiliation string matching for phase two matching
Jun 5, 2015
|
jl987-Jie
added a commit
that referenced
this issue
Jun 28, 2015
/**
* Extract Department information from string of the form "Department of *,".
*
* @param department Department string
* @return Department name.
*/
private String extractDepartment(String department) {
final Pattern pattern = Pattern.compile("Department of (.+?),");
final Matcher matcher = pattern.matcher(department);
if (matcher.find()) {
return matcher.group(1);
} else {
return "";
}
}
/**
* Leverage departmental affiliation string matching for phase two matching.
*
* If reCiterAuthor has department information, extract the "department of ***" string and use string comparison
* to match to target author's primary department and other department fields. If both party's department match,
* return true, else return false.
*
* (Github issue: https://github.com/wcmc-its/ReCiter/issues/79)
* @return True if the department of the ReCiterAuthor and TargetAuthor match.
*/
public boolean departmentMatch(ReCiterAuthor reCiterAuthor, TargetAuthor targetAuthor) {
if (reCiterAuthor.getAffiliation() != null) {
String affiliation = reCiterAuthor.getAffiliation().getAffiliationName();
String extractedDept = extractDepartment(affiliation);
String targetAuthorDept = targetAuthor.getDepartment();
String targetAuthorOtherDept = targetAuthor.getOtherDeparment();
if (extractedDept.equalsIgnoreCase(targetAuthorDept) || extractedDept.equalsIgnoreCase(targetAuthorOtherDept)) {
return true;
}
}
return false;
} |
Hanumantha has implemented and reports that Jie has integrated his code into his the ReCiterAlgorithmRevisionJul2015 branch. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Use "Department of [target author's department(s) as tracked in rc_identity]" to match target co-authors
Sometimes the affiliation of the target co-author in PubMed will explicitly state the department. For example:
Other examples:
Related to #46
The text was updated successfully, but these errors were encountered: