NCBI C++ ToolKit
|
#include <ncbi_pch.hpp>
#include <sstream>
#include <objects/general/User_object.hpp>
#include <objects/seq/Pubdesc.hpp>
#include <objects/pub/Pub.hpp>
#include <objects/pub/Pub_equiv.hpp>
#include <objects/biblio/Cit_gen.hpp>
#include <objects/biblio/Cit_sub.hpp>
#include <objects/biblio/Cit_art.hpp>
#include <objects/biblio/Cit_jour.hpp>
#include <objects/biblio/Cit_let.hpp>
#include <objects/biblio/Cit_book.hpp>
#include <objects/biblio/Cit_pat.hpp>
#include <objects/biblio/Cit_proc.hpp>
#include <objects/biblio/Title.hpp>
#include <objects/biblio/Auth_list.hpp>
#include <objects/biblio/Author.hpp>
#include <objects/biblio/Affil.hpp>
#include <objects/biblio/Imprint.hpp>
#include <objects/general/Name_std.hpp>
#include <objects/general/Object_id.hpp>
#include <objects/general/Person_id.hpp>
#include <objects/submit/Submit_block.hpp>
#include <objects/submit/Contact_info.hpp>
#include <corelib/ncbistre.hpp>
#include <objmgr/seqdesc_ci.hpp>
#include "discrepancy_core.hpp"
Go to the source code of this file.
Go to the SVN repository for this file.
Macros | |
#define | ADD_TO_AFFIL_SUMMARY(Fieldname) |
#define | REPORT_CITSUBAFFIL_CONFLICT(order, field, alias) |
Variables | |
const string | kTitleAuthorConflictStart = "[n] articles have title '" |
const string | kTitleAuthorConflictEnd = "' but do not have the same author list" |
static constexpr CDiscrepancyCaseProps | s_testcase_props_TITLE_AUTHOR_CONFLICT = { CDiscrepancyVisitorImpl<eTestNames:: TITLE_AUTHOR_CONFLICT >::Create, eTestTypes:: DESC , eTestNames:: TITLE_AUTHOR_CONFLICT , "TITLE_AUTHOR_CONFLICT" , "Publications with the same titles should have the same authors" , eDisc | eOncaller | eSmart | eFatal , nullptr } |
static const char * | kTitleAuthorConflict = "Publication Title/Author Inconsistencies" |
static constexpr CDiscrepancyCaseProps | s_testcase_props_UNPUB_PUB_WITHOUT_TITLE = { CDiscrepancyVisitorImpl<eTestNames:: UNPUB_PUB_WITHOUT_TITLE >::Create, eTestTypes:: PUBDESC , eTestNames:: UNPUB_PUB_WITHOUT_TITLE , "UNPUB_PUB_WITHOUT_TITLE" , "Unpublished pubs should have titles" , eDisc | eOncaller | eSubmitter | eSmart | eBig | eFatal , nullptr } |
static constexpr CDiscrepancyCaseProps | s_testcase_props_MISSING_AFFIL = { CDiscrepancyVisitorImpl<eTestNames:: MISSING_AFFIL >::Create, eTestTypes:: PUBDESC , eTestNames:: MISSING_AFFIL , "MISSING_AFFIL" , "Missing affiliation" , eDisc | eOncaller | eFatal , nullptr } |
const string | kCitSubSummary = "Citsub affiliation conflicts found" |
const string | kSummaries = "summaries" |
static constexpr CDiscrepancyCaseProps | s_testcase_props_CITSUBAFFIL_CONFLICT = { CDiscrepancyVisitorImpl<eTestNames:: CITSUBAFFIL_CONFLICT >::Create, eTestTypes:: AUTHORS , eTestNames:: CITSUBAFFIL_CONFLICT , "CITSUBAFFIL_CONFLICT" , "All Cit-subs should have identical affiliations" , eDisc | eOncaller | eSmart | eFatal , nullptr } |
static constexpr CDiscrepancyCaseProps | s_testcase_props_SUBMITBLOCK_CONFLICT = { CDiscrepancyVisitorImpl<eTestNames:: SUBMITBLOCK_CONFLICT >::Create, eTestTypes:: SUBMIT , eTestNames:: SUBMITBLOCK_CONFLICT , "SUBMITBLOCK_CONFLICT" , "Records should have identical submit-blocks" , eDisc | eOncaller | eSmart , nullptr } |
static constexpr CDiscrepancyCaseProps | s_testcase_props_CONSORTIUM = { CDiscrepancyVisitorImpl<eTestNames:: CONSORTIUM >::Create, eTestTypes:: AUTHORS , eTestNames:: CONSORTIUM , "CONSORTIUM" , "Submitter blocks and publications have consortiums" , eOncaller , nullptr } |
const string | kMissingAuthorsName = "[n] pub[s] missing author\'s first or last name" |
static constexpr CDiscrepancyCaseProps | s_testcase_props_CHECK_AUTH_NAME = { CDiscrepancyVisitorImpl<eTestNames:: CHECK_AUTH_NAME >::Create, eTestTypes:: AUTHORS , eTestNames:: CHECK_AUTH_NAME , "CHECK_AUTH_NAME" , "Missing authors or first/last author's names" , eDisc | eOncaller | eSubmitter | eSmart , nullptr } |
static constexpr CDiscrepancyCaseProps | s_testcase_props_CITSUB_AFFIL_DUP_TEXT = { CDiscrepancyVisitorImpl<eTestNames:: CITSUB_AFFIL_DUP_TEXT >::Create, eTestTypes:: PUBDESC , eTestNames:: CITSUB_AFFIL_DUP_TEXT , "CITSUB_AFFIL_DUP_TEXT" , "Cit-sub affiliation street contains text from other affiliation fields" , eOncaller , nullptr } |
static pair< string, string > | us_state_abbreviations [] |
static size_t | kNumOfAbbreviations = ArraySize(us_state_abbreviations) |
static constexpr CDiscrepancyCaseProps | s_testcase_props_USA_STATE = { CDiscrepancyVisitorImpl<eTestNames:: USA_STATE >::Create, eTestTypes:: PUBDESC , eTestNames:: USA_STATE , "USA_STATE" , "For country USA, state should be present and abbreviated" , eDisc | eOncaller | eSmart , nullptr } |
static const string | kIncorrectCap = "[n] pub[s] [has] incorrect author capitalization" |
static constexpr CDiscrepancyCaseProps | s_testcase_props_CHECK_AUTH_CAPS = { CDiscrepancyVisitorImpl<eTestNames:: CHECK_AUTH_CAPS >::Create, eTestTypes:: AUTHORS , eTestNames:: CHECK_AUTH_CAPS , "CHECK_AUTH_CAPS" , "Check for correct capitalization in author names" , eDisc | eOncaller | eSmart , nullptr } |
#define ADD_TO_AFFIL_SUMMARY | ( | Fieldname | ) |
Definition at line 440 of file pub_tests.cpp.
#define REPORT_CITSUBAFFIL_CONFLICT | ( | order, | |
field, | |||
alias | |||
) |
Definition at line 720 of file pub_tests.cpp.
References AffilStreetEndsWith(), CAffil_Base::C_Std::GetCity(), CAffil_Base::C_Std::GetCountry(), CAffil_Base::C_Std::GetPostal_code(), CAffil_Base::GetStd(), CAffil_Base::C_Std::GetStreet(), CAffil_Base::C_Std::GetSub(), CAffil_Base::C_Std::IsSetCity(), CAffil_Base::C_Std::IsSetCountry(), CAffil_Base::C_Std::IsSetPostal_code(), CAffil_Base::C_Std::IsSetStreet(), CAffil_Base::C_Std::IsSetSub(), and CAffil_Base::IsStd().
Referenced by CDiscrepancyVisitorImpl< _Name >::Autofix().
Definition at line 704 of file pub_tests.cpp.
References NStr::EndsWith(), NStr::eNocase, ispunct(), and isspace().
Referenced by AffilStreetContainsDup(), and RemoveAffilStreetEnd().
|
static |
Definition at line 1176 of file pub_tests.cpp.
References FixCapitalization(), CName_std_Base::GetFirst(), CName_std_Base::GetInitials(), CName_std_Base::GetLast(), isalpha(), IsCapInitialsCorrect(), IsCapNameCorrect(), islower(), CName_std_Base::IsSetFirst(), CName_std_Base::IsSetInitials(), CName_std_Base::IsSetLast(), CName_std_Base::SetFirst(), CName_std_Base::SetInitials(), CName_std_Base::SetLast(), CAuth_list_Base::SetNames(), and toupper().
Definition at line 1147 of file pub_tests.cpp.
References isalpha(), islower(), isupper(), tolower(), and toupper().
Referenced by CDiscrepancyVisitorImpl< _Name >::Autofix(), and FixCapitalization().
string GetAuthorString | ( | const CAuth_list & | auth_list | ) |
Definition at line 109 of file pub_tests.cpp.
References a, CAuth_list_Base::C_Names::e_Ml, CAuth_list_Base::C_Names::e_Std, CAuth_list_Base::C_Names::e_Str, GetAuthorString(), CAuth_list_Base::C_Names::GetMl(), CAuth_list_Base::GetNames(), CAuth_list_Base::C_Names::GetStd(), CAuth_list_Base::C_Names::GetStr(), NStr::IsBlank(), CAuth_list_Base::IsSetNames(), and CAuth_list_Base::C_Names::Which().
Definition at line 83 of file pub_tests.cpp.
References CPerson_id_Base::e_Consortium, CPerson_id_Base::e_Ml, CPerson_id_Base::e_Name, CPerson_id_Base::e_Str, GetAuthorString(), CPerson_id_Base::GetConsortium(), CPerson_id_Base::GetMl(), CAuthor_Base::GetName(), CPerson_id_Base::GetName(), CPerson_id_Base::GetStr(), CAuthor_Base::IsSetName(), kEmptyStr, and CPerson_id_Base::Which().
Definition at line 69 of file pub_tests.cpp.
References NStr::IsBlank().
Referenced by GetAuthorString(), and GetPubTitleAndAuthors().
Definition at line 686 of file pub_tests.cpp.
References CPub_equiv_Base::Get(), CPub_Base::GetEquiv(), CPub_Base::GetSub(), CPub_Base::IsEquiv(), CPub_equiv_Base::IsSet(), and CPub_Base::IsSub().
Referenced by CDiscrepancyVisitorImpl< _Name >::Autofix().
Definition at line 153 of file pub_tests.cpp.
References CPub_Base::e_Article, CPub_Base::e_Book, CPub_Base::e_Gen, CPub_Base::e_Man, CPub_Base::e_Patent, CPub_Base::GetArticle(), CCit_art_Base::GetAuthors(), CCit_book_Base::GetAuthors(), CCit_gen_Base::GetAuthors(), CCit_pat_Base::GetAuthors(), GetAuthorString(), CPub_Base::GetBook(), CCit_let_Base::GetCit(), CPub_Base::GetGen(), CPub_Base::GetMan(), CPub_Base::GetPatent(), CTitle::GetTitle(), CCit_art_Base::GetTitle(), CCit_book_Base::GetTitle(), CCit_gen_Base::GetTitle(), CCit_pat_Base::GetTitle(), CCit_art_Base::IsSetAuthors(), CCit_book_Base::IsSetAuthors(), CCit_gen_Base::IsSetAuthors(), CCit_pat_Base::IsSetAuthors(), CCit_let_Base::IsSetCit(), CCit_art_Base::IsSetTitle(), CCit_book_Base::IsSetTitle(), CCit_gen_Base::IsSetTitle(), CCit_pat_Base::IsSetTitle(), and CPub_Base::Which().
Referenced by GetPubTitleAndAuthors(), and HasUnpubWithoutTitle().
Definition at line 204 of file pub_tests.cpp.
References CPub_equiv_Base::Get(), CPubdesc_Base::GetPub(), GetPubTitleAndAuthors(), NStr::IsBlank(), and CPubdesc_Base::IsSetPub().
Definition at line 389 of file pub_tests.cpp.
References CAffil_Base::C_Std::GetAffil(), CAffil_Base::GetStd(), CAffil_Base::GetStr(), NStr::IsBlank(), CAffil_Base::C_Std::IsSetAffil(), CAffil_Base::IsStd(), and CAffil_Base::IsStr().
Referenced by IsCitSubMissingAffiliation().
Definition at line 358 of file pub_tests.cpp.
References NStr::EqualNocase(), CPub_equiv_Base::Get(), CPubdesc_Base::GetPub(), GetPubTitleAndAuthors(), NStr::IsBlank(), IsPubUnpublished(), and CPubdesc_Base::IsSetPub().
Definition at line 1104 of file pub_tests.cpp.
References isalpha(), and islower().
Referenced by FixCapitalization().
Definition at line 1044 of file pub_tests.cpp.
References set< Key, Compare >::find(), i, isalpha(), islower(), len, and set< Key, Compare >::size().
Referenced by FixCapitalization().
Definition at line 408 of file pub_tests.cpp.
References CPub_equiv_Base::Get(), CPubdesc_Base::GetPub(), HasNoAffiliation(), and CPubdesc_Base::IsSetPub().
Definition at line 284 of file pub_tests.cpp.
References CCit_book_Base::GetImp(), IsPubUnpublished(), and CCit_book_Base::IsSetImp().
Definition at line 274 of file pub_tests.cpp.
References IsPubUnpublished(), and journal().
Definition at line 304 of file pub_tests.cpp.
References CCit_let_Base::GetCit(), CCit_book_Base::GetImp(), IsPubUnpublished(), CCit_let_Base::IsSetCit(), and CCit_book_Base::IsSetImp().
Definition at line 294 of file pub_tests.cpp.
References IsPubUnpublished(), and proc.
Definition at line 264 of file pub_tests.cpp.
References CImprint_Base::ePrepub_other, CImprint_Base::GetPrepub(), and CImprint_Base::IsSetPrepub().
Referenced by HasUnpubWithoutTitle(), and IsPubUnpublished().
Definition at line 314 of file pub_tests.cpp.
References CPub_Base::e_Article, CPub_Base::e_Book, CPub_Base::e_Gen, CPub_Base::e_Journal, CPub_Base::e_Man, CPub_Base::e_Patent, CPub_Base::e_Proc, NStr::FindNoCase(), CPub_Base::GetArticle(), CCit_art_Base::C_From::GetBook(), CPub_Base::GetBook(), CCit_gen_Base::GetCit(), CCit_art_Base::GetFrom(), CPub_Base::GetGen(), CCit_art_Base::C_From::GetJournal(), CPub_Base::GetJournal(), CPub_Base::GetMan(), CCit_art_Base::C_From::GetProc(), CPub_Base::GetProc(), CCit_art_Base::C_From::IsBook(), CCit_art_Base::C_From::IsJournal(), CCit_art_Base::C_From::IsProc(), IsPubUnpublished(), CCit_gen_Base::IsSetCit(), CCit_art_Base::IsSetFrom(), NPOS, and CPub_Base::Which().
Definition at line 938 of file pub_tests.cpp.
References first(), i, kNumOfAbbreviations, and us_state_abbreviations.
Referenced by CDiscrepancyVisitorImpl< _Name >::Autofix().
Definition at line 782 of file pub_tests.cpp.
References CAffil_Base::C_Std::GetCity(), CAffil_Base::C_Std::GetCountry(), CAffil_Base::C_Std::GetPostal_code(), CAffil_Base::C_Std::GetSub(), CAffil_Base::C_Std::IsSetCity(), CAffil_Base::C_Std::IsSetCountry(), CAffil_Base::C_Std::IsSetPostal_code(), CAffil_Base::C_Std::IsSetSub(), RemoveAffilStreetEnd(), CCit_sub_Base::SetAuthors(), CAffil_Base::SetStd(), and CAffil_Base::C_Std::SetStreet().
Referenced by CDiscrepancyVisitorImpl< _Name >::Autofix().
Definition at line 765 of file pub_tests.cpp.
References AffilStreetEndsWith(), NStr::EndsWith(), NStr::eNocase, NStr::EqualNocase(), NStr::fSS_alnum, NStr::fSS_NoTruncate_Begin, and NStr::Sanitize().
Referenced by RemoveAffilDup().
|
static |
Definition at line 610 of file pub_tests.cpp.
References n, names, and CAuth_list_Base::SetNames().
Referenced by CDiscrepancyVisitorImpl< _Name >::Autofix().
Definition at line 981 of file pub_tests.cpp.
References NStr::EqualNocase(), first(), CAffil_Base::GetStd(), CAffil_Base::C_Std::GetSub(), i, CAffil_Base::C_Std::IsSetSub(), kNumOfAbbreviations, CAffil_Base::SetStd(), CAffil_Base::C_Std::SetSub(), and us_state_abbreviations.
Referenced by CDiscrepancyVisitorImpl< _Name >::Autofix().
Definition at line 468 of file pub_tests.cpp.
References CAffil_Base::GetStd(), CAffil_Base::GetStr(), CAffil_Base::IsStd(), CAffil_Base::IsStr(), kEmptyStr, and SummarizeAffiliation().
string SummarizeAffiliation | ( | const CAffil::C_Std & | affil | ) |
Definition at line 448 of file pub_tests.cpp.
References ADD_TO_AFFIL_SUMMARY, CAffil_Base::C_Std::GetPostal_code(), NStr::IsBlank(), and CAffil_Base::C_Std::IsSetPostal_code().
Referenced by SummarizeAffiliation().
USING_SCOPE | ( | objects | ) |
Definition at line 480 of file pub_tests.cpp.
Referenced by CDiscrepancyVisitorImpl< _Name >::Summarize().
Definition at line 1042 of file pub_tests.cpp.
Definition at line 657 of file pub_tests.cpp.
|
static |
Definition at line 936 of file pub_tests.cpp.
Referenced by IsValidStateAbbreviation(), and ReplaceStateAbbreviation().
Definition at line 481 of file pub_tests.cpp.
Referenced by CDiscrepancyVisitorImpl< _Name >::Summarize().
|
static |
Definition at line 234 of file pub_tests.cpp.
Referenced by CDiscrepancyVisitorImpl< _Name >::Summarize().
Definition at line 67 of file pub_tests.cpp.
Definition at line 66 of file pub_tests.cpp.
|
staticconstexpr |
Definition at line 1119 of file pub_tests.cpp.
|
staticconstexpr |
Definition at line 659 of file pub_tests.cpp.
|
staticconstexpr |
Definition at line 743 of file pub_tests.cpp.
|
staticconstexpr |
Definition at line 484 of file pub_tests.cpp.
|
staticconstexpr |
Definition at line 590 of file pub_tests.cpp.
|
staticconstexpr |
Definition at line 428 of file pub_tests.cpp.
|
staticconstexpr |
Definition at line 560 of file pub_tests.cpp.
|
staticconstexpr |
Definition at line 219 of file pub_tests.cpp.
|
staticconstexpr |
Definition at line 377 of file pub_tests.cpp.
|
staticconstexpr |
Definition at line 949 of file pub_tests.cpp.
Definition at line 839 of file pub_tests.cpp.
Referenced by IsValidStateAbbreviation(), and ReplaceStateAbbreviation().