NCBI C++ ToolKit
Classes | Macros | Typedefs | Functions | Variables
cleanup_author.cpp File Reference
#include <ncbi_pch.hpp>
#include <corelib/ncbistd.hpp>
#include <serial/serialbase.hpp>
#include <objects/biblio/Affil.hpp>
#include <objects/biblio/Author.hpp>
#include <objects/biblio/Auth_list.hpp>
#include <objects/general/Name_std.hpp>
#include <objects/general/Person_id.hpp>
#include <objtools/cleanup/cleanup.hpp>
#include <objtools/cleanup/cleanup_pub.hpp>
#include "cleanup_utils.hpp"
+ Include dependency graph for cleanup_author.cpp:

Go to the source code of this file.

Go to the SVN repository for this file.

Classes

struct  SAuthorEmpty
 

Macros

#define EXTRACTSUFFIXFROMINITIALS(OLD, NEW)
 
#define CLEAN_AFFIL_MEMBER(x)
 

Typedefs

typedef SStaticPair< const char *, const char * > TStringPair
 
typedef CStaticArrayMap< string, stringTSuffixMap
 

Functions

 DEFINE_STATIC_ARRAY_MAP_WITH_COPY (TSuffixMap, sc_BadSuffixes, bad_sfxs)
 
static bool CleanAndCompressJunk (string &str)
 

Variables

static const TStringPair bad_sfxs []
 

Macro Definition Documentation

◆ CLEAN_AFFIL_MEMBER

#define CLEAN_AFFIL_MEMBER (   x)
Value:
if (std.IsSet##x()) { \
string& val = std.Set##x(); \
rval |= CleanAndCompressJunk(val); \
if (val.empty()) { \
std.Reset##x(); \
rval = true; \
} \
}
static bool CleanAndCompressJunk(string &str)

◆ EXTRACTSUFFIXFROMINITIALS

#define EXTRACTSUFFIXFROMINITIALS (   OLD,
  NEW 
)
Value:
if( NStr::EndsWith(initials, OLD) ) { \
initials.resize( initials.length() - strlen(OLD) ); \
name.SetSuffix(NEW); \
return; \
}
static bool EndsWith(const CTempString str, const CTempString end, ECase use_case=eCase)
Check if a string ends with a specified suffix value.
Definition: ncbistr.hpp:5429

Typedef Documentation

◆ TStringPair

typedef SStaticPair<const char*, const char*> TStringPair

Definition at line 352 of file cleanup_author.cpp.

◆ TSuffixMap

Definition at line 372 of file cleanup_author.cpp.

Function Documentation

◆ CleanAndCompressJunk()

static bool CleanAndCompressJunk ( string str)
static

Definition at line 576 of file cleanup_author.cpp.

References Asn2gnbkCompressSpaces(), CleanVisStringJunk(), and str().

◆ DEFINE_STATIC_ARRAY_MAP_WITH_COPY()

DEFINE_STATIC_ARRAY_MAP_WITH_COPY ( TSuffixMap  ,
sc_BadSuffixes  ,
bad_sfxs   
)

Variable Documentation

◆ bad_sfxs

const TStringPair bad_sfxs[]
static
Initial value:
= {
{ "1d" , "I" },
{ "1st" , "I" },
{ "2d" , "II" },
{ "2nd" , "II" },
{ "3d" , "III" },
{ "3rd" , "III" },
{ "4th" , "IV" },
{ "5th" , "V" },
{ "6th" , "VI" },
{ "II." , "II" },
{ "III.", "III" },
{ "IV." , "IV" },
{ "Jr" , "Jr." },
{ "Sr" , "Sr." },
{ "VI." , "VI" }
}

Definition at line 353 of file cleanup_author.cpp.

Modified on Fri Dec 08 08:19:15 2023 by modify_doxy.py rev. 669887