NCBI C++ ToolKit
pubdesc_editor.cpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 /* $Id: pubdesc_editor.cpp 47035 2022-05-24 15:30:00Z rudnev $
2  * ===========================================================================
3  *
4  * PUBLIC DOMAIN NOTICE
5  * National Center for Biotechnology Information
6  *
7  * This software/database is a "United States Government Work" under the
8  * terms of the United States Copyright Act. It was written as part of
9  * the author's official duties as a United States Government employee and
10  * thus cannot be copyrighted. This software/database is freely available
11  * to the public for use. The National Library of Medicine and the U.S.
12  * Government have not placed any restriction on its use or reproduction.
13  *
14  * Although all reasonable efforts have been taken to ensure the accuracy
15  * and reliability of the software and data, the NLM and the U.S.
16  * Government do not and cannot warrant the performance or results that
17  * may be obtained by using this software or data. The NLM and the U.S.
18  * Government disclaim all warranties, express or implied, including
19  * warranties of performance, merchantability or fitness for any particular
20  * purpose.
21  *
22  * Please cite the author in any work or product based on this material.
23  *
24  * ===========================================================================
25  *
26  * Authors: Igor Filippov
27  */
28 
29 #include <ncbi_pch.hpp>
35 
36 #include <objmgr/seqdesc_ci.hpp>
37 #include <objmgr/seq_entry_ci.hpp>
48 
53 
56 
58 {
59  if (!tse)
60  return CRef<CCmdComposite>();
61 
62  m_tse = tse;
64 
65  x_ApplyToSeqAndFeat(composite);
66  if (submit && submit->IsSetSub()) {
67  m_SubmitBlock.Reset(&(submit->GetSub()));
68  x_ApplyToSeqSubmit(composite);
69  }
70  return composite;
71 }
72 
74 {
75  x_ApplyToDescriptors(*(m_tse.GetCompleteSeq_entry()), composite);
76 
77  for (CFeat_CI feat_it(m_tse, SAnnotSelector(CSeqFeatData::e_Pub)); feat_it; ++feat_it) {
78  CRef<CSeq_feat> new_feat(new CSeq_feat());
79  new_feat->Assign(feat_it->GetOriginalFeature());
80  if (x_ApplyToPubdesc(new_feat->SetData().SetPub())) {
81  CRef<CCmdChangeSeq_feat> cmd(new CCmdChangeSeq_feat(*feat_it, *new_feat));
82  composite->AddCommand(*cmd);
83  }
84  }
85 }
86 
88 {
90  if ((*it)->IsPub()) {
91  const CSeqdesc& orig_desc = **it;
92  CRef<CSeqdesc> new_desc(new CSeqdesc);
93  new_desc->Assign(orig_desc);
94  if (x_ApplyToPubdesc(new_desc->SetPub())) {
95  CRef<CCmdChangeSeqdesc> cmd(new CCmdChangeSeqdesc(m_tse.GetScope().GetSeq_entryHandle(se), orig_desc, *new_desc));
96  composite->AddCommand(*cmd);
97  }
98  }
99  }
100 
101  if (se.IsSet()) {
103  x_ApplyToDescriptors(**it, composite);
104  }
105  }
106 }
107 
108 
110 {
111  bool modified = false;
112  EDIT_EACH_PUB_ON_PUBDESC(pub_iter, pubdesc) {
113  CPub& pub = **pub_iter;
114  string title;
115  switch (pub.Which()) {
116  case CPub::e_Article: {
117  CCit_art& art = pub.SetArticle();
118  if (art.IsSetTitle())
119  {
120  title = s_GetTitle(art.GetTitle());
121  if (!NStr::IsBlank(title))
122  {
123  modified = x_FixTitle(title);
124  if (modified)
125  s_SetTitle(art.SetTitle(), title);
126  }
127  }
128  }
129  break;
130  case CPub::e_Gen:
131  if (pub.GetGen().IsSetTitle()) {
132  title = pub.GetGen().GetTitle();
133  if (!NStr::IsBlank(title))
134  {
135  modified = x_FixTitle(title);
136  if (modified)
137  pub.SetGen().SetTitle(title);
138  }
139  }
140  break;
141  case CPub::e_Sub:
142  if (pub.GetSub().IsSetDescr()) {
143  title = pub.GetSub().GetDescr();
144  if (!NStr::IsBlank(title))
145  {
146  modified = x_FixTitle(title);
147  if (modified)
148  pub.SetSub().SetDescr(title);
149  }
150  }
151  break;
152  case CPub::e_Patent:
153  if (pub.GetPatent().IsSetTitle()) {
154  title = pub.GetPatent().GetTitle();
155  if (!NStr::IsBlank(title))
156  {
157  modified = x_FixTitle(title);
158  if (modified)
159  pub.SetPatent().SetTitle(title);
160  }
161  }
162  break;
163  default:
164  break;
165  }
166  }
167  return modified;
168 }
169 
170 string CFixTitleCap::s_GetTitle(const CTitle& title) // CValidError_imp::HasTitle(const CTitle& title) in valid_pub.cpp
171 {
172  ITERATE(CTitle::Tdata, item, title.Get()) {
173  const string *str = 0;
174  switch ((*item)->Which()) {
175  case CTitle::C_E::e_Name:
176  str = &(*item)->GetName();
177  break;
178 
179  case CTitle::C_E::e_Tsub:
180  str = &(*item)->GetTsub();
181  break;
182 
184  str = &(*item)->GetTrans();
185  break;
186 
187  case CTitle::C_E::e_Jta:
188  str = &(*item)->GetJta();
189  break;
190 
192  str = &(*item)->GetIso_jta();
193  break;
194 
196  str = &(*item)->GetMl_jta();
197  break;
198 
200  str = &(*item)->GetCoden();
201  break;
202 
203  case CTitle::C_E::e_Issn:
204  str = &(*item)->GetIssn();
205  break;
206 
207  case CTitle::C_E::e_Abr:
208  str = &(*item)->GetAbr();
209  break;
210 
211  case CTitle::C_E::e_Isbn:
212  str = &(*item)->GetIsbn();
213  break;
214 
215  default:
216  break;
217  };
218  if (!NStr::IsBlank(*str)) return *str;
219 
220  }
221  return "";
222 }
223 
224 void CFixTitleCap::s_SetTitle(CTitle& title, const string& value) // CValidError_imp::HasTitle(const CTitle& title) in valid_pub.cpp
225 {
226  NON_CONST_ITERATE(CTitle::Tdata, item, title.Set()) {
227  switch ((*item)->Which()) {
228  case CTitle::C_E::e_Name:
229  (*item)->SetName(value);
230  break;
231 
232  case CTitle::C_E::e_Tsub:
233  (*item)->SetTsub(value);
234  break;
235 
237  (*item)->SetTrans(value);
238  break;
239 
240  case CTitle::C_E::e_Jta:
241  (*item)->SetJta(value);
242  break;
243 
245  (*item)->SetIso_jta(value);
246  break;
247 
249  (*item)->SetMl_jta(value);
250  break;
251 
253  (*item)->SetCoden(value);
254  break;
255 
256  case CTitle::C_E::e_Issn:
257  (*item)->SetIssn(value);
258  break;
259 
260  case CTitle::C_E::e_Abr:
261  (*item)->SetAbr(value);
262  break;
263 
264  case CTitle::C_E::e_Isbn:
265  (*item)->SetIsbn(value);
266  break;
267 
268  default:
269  break;
270  };
271  }
272 }
273 
274 bool CFixTitleCap::x_FixTitle(string& title)
275 {
276  string fixed_title = macro::CMacroFunction_FixPubCaps::s_FixCapitalizationInTitle(title, true, m_tse);
277  if (fixed_title != title) {
278  title = fixed_title;
279  return true;
280  }
281  return false;
282 }
283 
284 
286 {
287  bool modified = false;
288 
289  CFixAffilCap affil_cap(m_tse);
290  modified |= affil_cap.x_ApplyToPubdesc(pubdesc);
291 
292  CFixAuthorCap author_cap(m_tse);
293  modified |= author_cap.x_ApplyToPubdesc(pubdesc);
294 
295  CFixTitleCap title_cap(m_tse);
296  modified |= title_cap.x_ApplyToPubdesc(pubdesc);
297 
298  return modified;
299 }
300 
301 
302 void CReloadPublications::LookUpByPmid(CPub& pub, TEntrezId pmid, bool& modified)
303 {
304  // prepare eFetch request
305  CGuiEutilsClient ecli;
306  ecli.SetMaxReturn(1);
307 
308  vector<TEntrezId> uids;
309  uids.push_back(pmid);
310 
311  CRef<CPubmed_entry> pubmed_entry(new CPubmed_entry());
312  CNcbiStrstream asnPubMedEntry;
313  try {
314  ecli.Fetch("pubmed", uids, asnPubMedEntry, "asn.1");
315  asnPubMedEntry >> MSerial_AsnText >> *pubmed_entry;
316  }
317  catch (const CException& e) {
318  LOG_POST(Error << "CReloadPublications::LookUpByPmid(): error fetching ID " << pmid << ": " << e.GetMsg());
319  return;
320  }
321 
322  if (pubmed_entry->CanGetMedent() && pubmed_entry->GetMedent().CanGetCit())
323  {
324  CCit_art& article = pubmed_entry->SetMedent().SetCit();
325  pub.SetArticle(article);
326  modified = true;
327  }
328 }
329 
331 {
332  bool modified = false;
333  TEntrezId pmid = ZERO_ENTREZ_ID;
334  EDIT_EACH_PUB_ON_PUBDESC(pub_iter, pubdesc) {
335  CPub& pub = **pub_iter;
336  switch (pub.Which()) {
337  case CPub::e_Pmid:
338  pmid = pub.GetPmid();
339  break;
340  default:
341  break;
342  }
343  }
344  if (pmid != ZERO_ENTREZ_ID)
345  {
346  EDIT_EACH_PUB_ON_PUBDESC(pub_iter, pubdesc) {
347  CPub& pub = **pub_iter;
348  switch (pub.Which()) {
349  case CPub::e_Article:
350  LookUpByPmid(pub, pmid, modified);
351  break;
352  default:
353  break;
354  }
355  }
356  }
357  return modified;
358 }
359 
360 
362 {
363  bool modified = false;
364  if (pubdesc.IsSetPub())
365  {
366  CPub_equiv& pe = pubdesc.SetPub();
367  x_ApplyToPubequiv(pe, modified);
368  }
369  return modified;
370 }
371 
373 {
374  EDIT_EACH_PUB_ON_PUBEQUIV (pub_iter, pe) {
375  CPub& pub = **pub_iter;
376  CAuth_list* authors = 0;
377  switch ( pub.Which() ) {
378  case CPub::e_Gen:
379  if ( pub.GetGen().IsSetAuthors() ) {
380  authors = &(pub.SetGen().SetAuthors());
381  }
382  break;
383  case CPub::e_Sub:
384  authors = &(pub.SetSub().SetAuthors());
385  break;
386  case CPub::e_Article:
387  if ( pub.GetArticle().IsSetAuthors() ) {
388  authors = &(pub.SetArticle().SetAuthors());
389  }
390  break;
391  case CPub::e_Book:
392  authors = &(pub.SetBook().SetAuthors());
393  break;
394  case CPub::e_Proc:
395  authors = &(pub.SetProc().SetBook().SetAuthors());
396  break;
397  case CPub::e_Man:
398  authors = &(pub.SetMan().SetCit().SetAuthors());
399  break;
400  case CPub::e_Patent:
401  authors = &(pub.SetPatent().SetAuthors());
402  break;
403  case CPub::e_Equiv:
404  x_ApplyToPubequiv(pub.SetEquiv(),modified);
405  break;
406  default:
407  break;
408  }
409 
410  if ( !authors ) continue;
411 
412  modified = x_ApplyToCAuth(*authors);
413  }
414 }
415 
417 {
418  if (m_SubmitBlock->IsSetCit() && m_SubmitBlock->GetCit().IsSetAuthors())
419  {
420  CRef<CSubmit_block> new_submit_block(new CSubmit_block);
421  new_submit_block->Assign(*m_SubmitBlock);
422  CAuth_list* authors = &(new_submit_block->SetCit().SetAuthors());
423  bool modified = x_ApplyToCAuth(*authors);
424  if (modified)
425  {
427  CObject* actual = (CObject*) (m_SubmitBlock.GetPointer());
428  cmd->Add(actual, CConstRef<CObject>(new_submit_block));
429  composite->AddCommand(*cmd);
430  }
431  }
432 }
433 
435 {
436  string res;
437  for (string::const_iterator p = orig.begin(); p != orig.end(); ++p)
438  {
439  bool need_dot = false;
440  if (isalpha(*p))
441  {
442  need_dot = true;
443  string::const_iterator n = p;
444  n++;
445  if (n != orig.end() && *n == '.')
446  need_dot = false;
447  }
448  res += toupper(*p);
449  if (need_dot)
450  res += '.';
451  }
452 
453  return res;
454 }
455 
456 bool IAuthorEditor::s_FixInitials(CPerson_id& pid) // TransferDataFromWindow in singleauthor_panel.cpp
457 {
458  bool modified = false;
459  if (pid.SetName().IsSetInitials())
460  {
461  string first_init;
462  if (pid.SetName().IsSetFirst())
463  {
464  string first = pid.GetName().GetFirst();
465  first_init = edit::GetFirstInitial(first,true);
466  }
467  string original_init = pid.GetName().GetInitials();
468  string middle_init = s_CapitalizeInitial(original_init);
469 
470  if (! NStr::IsBlank(first_init) && NStr::StartsWith(middle_init, first_init, NStr::eNocase))
471  middle_init = middle_init.substr(first_init.length());
472  else if (!NStr::IsBlank(middle_init) && NStr::StartsWith(first_init, middle_init, NStr::eNocase))
473  middle_init.clear();
474  string init = first_init;
475  if (!NStr::IsBlank(middle_init)) init += middle_init;
476  if (!NStr::IsBlank(init) && init != original_init)
477  {
478  pid.SetName().SetInitials(init);
479  modified = true;
480  }
481  }
482  return modified;
483 }
484 
485 static bool s_CleanVisString( string &str )
486 {
487  bool changed = false;
488 
489  if( str.empty() ) {
490  return false;
491  }
492 
493  // chop off initial junk
494  {
495  string::size_type first_good_char_pos = str.find_first_not_of(" ;,");
496  if( first_good_char_pos == string::npos ) {
497  // string is completely junk
498  str.clear();
499  return true;
500  } else if( first_good_char_pos > 0 ) {
501  copy( str.begin() + first_good_char_pos, str.end(), str.begin() );
502  str.resize( str.length() - first_good_char_pos );
503  changed = true;
504  }
505  }
506 
507  // chop off end junk
508 
509  string::size_type last_good_char_pos = str.find_last_not_of(" ;,");
510  _ASSERT( last_good_char_pos != string::npos ); // we checked this case so it shouldn't happen
511  if( last_good_char_pos == (str.length() - 1) ) {
512  // nothing to chop of the end
513  return changed;
514  } else if( str[last_good_char_pos+1] == ';' ) {
515  // special extra logic for semicolons because it might be part of
516  // an HTML character like "&nbsp;"
517 
518  // see if there's a '&' before the semicolon
519  // ( ' ' and ',' would break the '&' and make it irrelevant, though )
520  string::size_type last_ampersand_pos = str.find_last_of("& ,", last_good_char_pos );
521  if( last_ampersand_pos == string::npos ) {
522  // no ampersand, so just chop off as normal
523  str.resize( last_good_char_pos + 1 );
524  return true;
525  }
526  switch( str[last_ampersand_pos] ) {
527  case '&':
528  // can't chop semicolon, so chop just after it
529  if( (last_good_char_pos + 2) == str.length() ) {
530  // semicolon is at end, so no chopping occurs
531  return changed;
532  } else {
533  // chop after semicolon
534  str.resize( last_good_char_pos + 2 );
535  return true;
536  }
537  case ' ':
538  case ',':
539  // ampersand (if any) is irrelevant due to intervening
540  // space or comma
541  str.resize( last_good_char_pos + 1 );
542  return true;
543  default:
544  _ASSERT(false);
545  return changed; // should be impossible to reach here
546  }
547 
548  } else {
549  str.resize( last_good_char_pos + 1 );
550  return true;
551  }
552 }
553 
555 {
556  _ASSERT( FIELD_IS_SET(name, Initials) && ! FIELD_IS_SET(name, Suffix) );
557 
558  string& initials = GET_MUTABLE(name, Initials);
559 
560  if (initials.find('.') == NPOS) {
561  return;
562  }
563 
564 // this macro is arguably more convenient than a function
565 #define EXTRACTSUFFIXFROMINITIALS( OLD, NEW ) \
566  if( NStr::EndsWith(initials, OLD) ) { \
567  initials.resize( initials.length() - strlen(OLD) ); \
568  SET_FIELD(name, Suffix, NEW); \
569  return; \
570  }
571 
572  EXTRACTSUFFIXFROMINITIALS( "III", "III" )
573  EXTRACTSUFFIXFROMINITIALS( "III.", "III" )
574  EXTRACTSUFFIXFROMINITIALS( "Jr", "Jr" )
575  EXTRACTSUFFIXFROMINITIALS( "2nd", "II" )
576  EXTRACTSUFFIXFROMINITIALS( "IV", "IV" )
577  EXTRACTSUFFIXFROMINITIALS( "IV.", "IV" )
578 
579 #undef EXTRACTSUFFIXFROMINITIALS
580 }
581 
582 
583 #define TRUNCATE_SPACES(o, x) \
584  if ((o).IsSet##x()) { \
585  NStr::TruncateSpacesInPlace((o).Set##x()); \
586  if (NStr::IsBlank((o).Get##x())) { \
587  (o).Reset##x(); \
588  } \
589  }
590 
591 #define CLEAN_STRING_MEMBER(o, x) \
592  if ((o).IsSet##x()) { \
593  s_CleanVisString((o).Set##x()); \
594  if (NStr::IsBlank((o).Get##x())) { \
595  (o).Reset##x(); \
596  } \
597  }
598 
600 {
601  if( FIELD_EQUALS(name, Last, "et") &&
602  ( FIELD_EQUALS(name, Initials, "al") ||
603  FIELD_EQUALS(name, Initials, "al.") ||
604  FIELD_EQUALS(name, Initials, "Al.") ) &&
605  ( RAW_FIELD_IS_EMPTY_OR_UNSET(name, First) ||
606  FIELD_EQUALS(name, Initials, "a") ) )
607  {
608  RESET_FIELD( name, Initials );
609  RESET_FIELD( name, First );
610  SET_FIELD( name, Last, "et al." );
611  }
612 }
613 
615 {
616  bool modified = false;
617 
618  if (!pid.IsName())
619  return modified;
620  CName_std& name = pid.SetName();
621  bool fix_initials = true;
622  // there's a lot of shuffling around (e.g. adding and removing
623  // periods in initials), so we can't determine
624  // if we've actually changed anything until we get to the end of
625  // this function.
626  CRef<CName_std> original_name( new CName_std );
627  original_name->Assign( name );
628 
629  // if initials starts with uppercase, we remember to
630  // upcase the whole thing later
631  bool upcaseinits = false;
632  if( isupper( GET_STRING_FLD_OR_BLANK(name, Initials)[0] ) ) {
633  upcaseinits = true;
634  }
635 
636  string first_initials;
637  // like in C: str = NameStdPtrToTabbedString (nsp, fixInitials);
638  {
639  if ( ! FIELD_IS_SET(name, Suffix) && FIELD_IS_SET(name, Initials) ) {
641  }
642  TRUNCATE_SPACES(name, First);
643  if( FIELD_IS_SET(name, Initials) ) {
644  NStr::ReplaceInPlace( GET_MUTABLE(name, Initials), ".", "" );
646  }
647  if( FIELD_IS_SET(name, Last) ) {
649  }
650  if( FIELD_IS_SET(name, Middle) ) {
652  }
653  s_FixEtAl( name );
654 
655  // extract initials from first name
656  // like in C: FirstNameToInitials (first, first_initials, sizeof (first_initials) - 1);
657  {
658  if ( FIELD_IS_SET(name, First) ) {
659  const string &first = GET_FIELD(name, First);
660  string::size_type next_pos = 0;
661  while ( next_pos < first.length() ) {
662  // skip initial spaces and hyphens
663  next_pos = first.find_first_not_of(" -", next_pos);
664  if( string::npos == next_pos ) break;
665  // if we hit an letter after that, copy the letter to inits
666  if( isalpha( first[next_pos] ) ) {\
667  first_initials += first[next_pos];
668  }
669  // find next space or hyphen
670  next_pos = first.find_first_of(" -", next_pos);
671  if( string::npos == next_pos ) break;
672  // if it's a hyphen, copy it
673  if( first[next_pos] == '-' ) {
674  first_initials += '-';
675  }
676  }
677  }
678  }
679 
680  if( FIELD_IS_SET(name, First) ) {
681  NStr::ReplaceInPlace( GET_MUTABLE(name, First), ".", "" );
683  }
684 
685  if (fix_initials) {
686  if( ! RAW_FIELD_IS_EMPTY_OR_UNSET(name, Initials) ) {
687  string & initials = GET_MUTABLE(name, Initials);
688 
689  // skip part of initials that matches first_initials
690  string::size_type initials_first_good_idx = 0;
691  for( ; initials_first_good_idx < initials.length() &&
692  initials_first_good_idx < first_initials.length() &&
693  initials[initials_first_good_idx] == first_initials[initials_first_good_idx] ;
694  ++initials_first_good_idx )
695  {
696  // do nothing
697  }
698 
699  if( initials_first_good_idx > 0 ) {
700  initials.erase( 0, initials_first_good_idx );
701  }
702  }
703  } else if ( RAW_FIELD_IS_EMPTY_OR_UNSET(name, Initials) && ! first_initials.empty() ) {
704  SET_FIELD(name, Initials, first_initials );
705  }
706 
707  if( FIELD_IS_SET(name, Suffix) ) {
708  NStr::ReplaceInPlace( GET_MUTABLE(name, Suffix), ".", "" );
710  }
711 
712  // This differs from C, which just deletes these fields.
713  CLEAN_STRING_MEMBER(name, Title);
714  CLEAN_STRING_MEMBER(name, Full);
715  }
716 
717  // like in C: nsp = TabbedStringToNameStdPtr (str, fixInitials);
718  {
719  // initials = remove_spaces(first_initials+initials)
720  if( fix_initials && ! first_initials.empty() ) {
721  SET_FIELD(name, Initials,
722  first_initials + GET_STRING_FLD_OR_BLANK(name, Initials) );
723  }
724  if( FIELD_IS_SET(name, Initials) ) {
725  string & initials = GET_MUTABLE(name, Initials);
726  NStr::ReplaceInPlace( initials, " ", "" );
727  NStr::ReplaceInPlace( initials, ",", "." );
728  NStr::ReplaceInPlace( initials, ".ST.", ".St." );
729 
730  string new_initials;
731  string::const_iterator initials_iter = initials.begin();
732  // modify initials. New version will be built in new_initials
733  for( ; initials_iter != initials.end(); ++initials_iter ) {
734  const char ch = *initials_iter;
735  switch( ch ) {
736  case '-':
737  // keep hyphens
738  new_initials += '-';
739  break;
740  case '.':
741  case ' ':
742  // erase periods and spaces
743  break;
744  default:
745  // other characters: keep them, BUT...
746  new_initials += ch;
747 
748  if( (initials_iter + 1) != initials.end()) {
749  const char next_char = *(initials_iter + 1);
750  if (! islower(next_char) ) {
751  // if next character is not lower, add period
752  new_initials += '.';
753  }
754  }
755  }
756  }
757 
758  if( initials != new_initials ) {
759  initials.swap(new_initials); // swap is faster than assignment
760  new_initials.clear();
761  }
762 
763  // add period if string is not empty and doesn't end with a period
764  if( ! initials.empty() && ! NStr::EndsWith(initials, ".") ) {
765  initials += '.';
766  }
767  }
768 
769  if( FIELD_IS_SET(name, Suffix) ) {
770  string &suffix = GET_MUTABLE(name, Suffix);
771  // remove spaces
772  NStr::ReplaceInPlace( suffix, " ", "" );
773 
774  if ( ! suffix.empty() ) {
775  // remove any period, if any, on the end
776  if( NStr::EndsWith(suffix, ".") ) {
777  suffix.resize( suffix.length() - 1 );
778  }
779 
780  if( NStr::EqualNocase(suffix, "1d") ) {
781  suffix = "I";
782  } else if( NStr::EqualNocase(suffix, "1st") ) {
783  suffix = "I";
784  } else if( NStr::EqualNocase(suffix, "2d") ) {
785  suffix = "II";
786  } else if( NStr::EqualNocase(suffix, "2nd") ) {
787  suffix = "II";
788  } else if( NStr::EqualNocase(suffix, "3d") ) {
789  suffix = "III";
790  } else if( NStr::EqualNocase(suffix, "3rd") ) {
791  suffix = "III";
792  } else if( NStr::EqualNocase(suffix, "4th") ) {
793  suffix = "IV";
794  } else if( NStr::EqualNocase(suffix, "5th") ) {
795  suffix = "V";
796  } else if( NStr::EqualNocase(suffix, "6th") ) {
797  suffix = "VI";
798  } else if( NStr::EqualNocase(suffix, "Sr") ) {
799  suffix = "Sr.";
800  } else if( NStr::EqualNocase(suffix, "Jr") ) {
801  suffix = "Jr.";
802  }
803  }
804  }
805 
806  // add dot to "et al"
807  if ( FIELD_EQUALS(name, Last, "et al") ) {
808  SET_FIELD(name, Last, "et al." );
809  }
810 
811  // reset middle if it's blank
812  if ( FIELD_EQUALS(name, Middle, kEmptyStr) ) {
813  RESET_FIELD(name, Middle);
814  }
815  }
816 
817  if (upcaseinits && FIELD_IS_SET(name, Initials) ) {
818  string & initials = GET_MUTABLE(name, Initials);
819  if( ! initials.empty() && islower(initials[0]) ) {
820  initials[0] = toupper(initials[0]);
821  }
822  }
823  CLEAN_STRING_MEMBER(name, Last);
824  CLEAN_STRING_MEMBER(name, First);
825  CLEAN_STRING_MEMBER(name, Middle);
826  CLEAN_STRING_MEMBER(name, Full);
827  CLEAN_STRING_MEMBER(name, Initials);
828  CLEAN_STRING_MEMBER(name, Suffix);
829  CLEAN_STRING_MEMBER(name, Title);
830  s_FixEtAl( name );
831 
832  if( ! FIELD_IS_SET(name, Last) ) {
833  SET_FIELD(name, Last, kEmptyCStr );
834  }
835  string &last = GET_MUTABLE(name, Last);
836  if( RAW_FIELD_IS_EMPTY_OR_UNSET(name, Suffix) &&
837  ( NStr::EndsWith(last, " Jr.") || NStr::EndsWith(last, " Sr.") ) )
838  {
839  SET_FIELD(name, Suffix, last.substr( last.length() - 3 ) );
840  last.resize( last.length() - 4 );
842  }
843 
844  if( FIELD_IS_SET(name, Initials) && RAW_FIELD_IS_EMPTY_OR_UNSET(name, Suffix) ) {
845  string & initials = GET_MUTABLE(name, Initials);
846  if( NStr::EndsWith(initials, ".Jr.") || NStr::EndsWith(initials, ".Sr.") ) {
847  SET_FIELD(name, Suffix, initials.substr( initials.length() - 3 ) );
848  initials.resize( initials.length() - 3 );
849  NStr::TruncateSpacesInPlace( initials );
850  }
851  }
852 
853  if( ! original_name->Equals(name) ) {
854  modified = true;
855  }
856  return modified;
857 }
858 
860 {
861  if (!tse || !obj)
862  return false;
863 
864  m_tse = tse;
865  const CSeq_feat* feat = dynamic_cast<const CSeq_feat*>(obj.GetPointerOrNull());
866  const CSeqdesc* seqdesc = dynamic_cast<const CSeqdesc*>(obj.GetPointerOrNull());
867  const CSubmit_block* sub_block = dynamic_cast<const CSubmit_block*>(obj.GetPointerOrNull());
868  bool modified = false;
869 
870  CScope& scope = m_tse.GetScope();
871  if (feat) {
872  CRef<CSeq_feat> new_feat(new CSeq_feat());
873  new_feat->Assign(*feat);
874  if (x_ApplyToPubdesc(new_feat->SetData().SetPub())) {
875  CSeq_feat_Handle fh = scope.GetSeq_featHandle(*feat);
876  CRef<CCmdChangeSeq_feat> cmd(new CCmdChangeSeq_feat(fh, *new_feat));
877  composite.AddCommand(*cmd);
878  modified = true;
879  }
880  }
881  else if (seqdesc) {
882  CRef<CSeqdesc> new_desc(new CSeqdesc);
883  new_desc->Assign(*seqdesc);
884  if (x_ApplyToPubdesc(new_desc->SetPub())) {
885  CSeq_entry_Handle seh = edit::GetSeqEntryForSeqdesc(Ref(&scope), *seqdesc);
886  CRef<CCmdChangeSeqdesc> cmd(new CCmdChangeSeqdesc(seh, *seqdesc, *new_desc));
887  composite.AddCommand(*cmd);
888  modified = true;
889  }
890  }
891  else if (sub_block) {
892  m_SubmitBlock.Reset(sub_block);
893  x_ApplyToSeqSubmit(&composite);
894  modified = true;
895  }
896  return modified;
897 }
898 
900 {
901  if (!authors.IsSetNames())
902  return false;
903 
904  bool modified = false;
905  CAuth_list::TNames &author_names = authors.SetNames();
906  if (author_names.IsStd()) {
907  for ( auto&& auth_it : author_names.SetStd()) {
908  CPerson_id &pid = auth_it->SetName();
909  modified |= macro::CMacroFunction_AuthorFix::s_ReverseAuthorNames(pid.SetName());
910  }
911  }
912  return modified;
913 }
914 
915 
917 {
918  if (!authors.IsSetNames())
919  return false;
920 
921  bool modified = false;
922  CAuth_list::TNames &author_names = authors.SetNames();
923  if (author_names.IsStd()) {
924  for (auto&& auth_it : author_names.SetStd()) {
925  CPerson_id &pid = auth_it->SetName();
926  if (pid.IsName()) {
927  modified |= macro::CMacroFunction_AuthorFix::s_TruncateMiddleInitials(pid.SetName());
928  }
929  }
930  }
931  return modified;
932 }
933 
934 static bool s_FixNameCap(string& name, bool bApostrophes)
935 {
936  string orig = name;
938  if (bApostrophes) CapitalizeAfterApostrophe(name);
939  return (orig != name);
940 }
941 
943 {
944  if (!authors.IsSetNames())
945  return false;
946 
947  bool modified = false;
948  CAuth_list::TNames &author_names = authors.SetNames();
949  if (author_names.IsStd()) {
950  for (auto&& auth_it : author_names.SetStd()) {
951  CPerson_id &pid = auth_it->SetName();
952  if (pid.IsName() && pid.GetName().IsSetLast() && pid.GetName().IsSetFirst())
953  {
954  string last = pid.GetName().GetLast();
955  string first = pid.GetName().GetFirst();
956  modified |= s_FixNameCap(last, true);
957  modified |= s_FixNameCap(first, false);
958  pid.SetName().SetLast(last);
959  pid.SetName().SetFirst(first);
960  modified |= s_FixInitials(pid);
961  }
962  }
963  }
964  return modified;
965 }
966 
968 {
969  if (!authors.IsSetNames())
970  return false;
971 
972  bool modified = false;
973  CAuth_list::TNames &author_names = authors.SetNames();
974  if (author_names.IsStd()) {
975  for (auto&& auth_it : author_names.SetStd()) {
976  CPerson_id &pid = auth_it->SetName();
977  if (pid.IsName() && pid.GetName().IsSetSuffix() && !NStr::IsBlank(pid.GetName().GetSuffix()))
978  {
979  pid.SetName().ResetSuffix();
980  modified = true;
981  }
982  }
983  }
984  return modified;
985 }
986 
988 {
989  if (!authors.IsSetNames())
990  return false;
991 
992  bool modified = false;
993  auto &author_names = authors.SetNames();
994  if (author_names.IsStd()) {
995  auto auth_it = author_names.SetStd().begin();
996  while (auth_it != author_names.SetStd().end()) {
997  CPerson_id &pid = (*auth_it)->SetName();
998  if (pid.IsConsortium()) {
999  auth_it = author_names.SetStd().erase(auth_it); // TODO - not quite clear what to do if we ever remove all names here
1000  modified = true;
1001  }
1002  else {
1003  ++auth_it;
1004  }
1005  }
1006  }
1007  return modified;
1008 }
1009 
1011 {
1012  if (!authors.IsSetNames())
1013  return false;
1014 
1015  bool modified = false;
1016  CAuth_list::TNames &author_names = authors.SetNames();
1017  if (author_names.IsStd()) {
1018  for (auto&& auth_it : author_names.SetStd()) {
1019  CPerson_id &pid = auth_it->SetName();
1020  if (pid.IsName() && pid.GetName().IsSetLast())
1021  {
1022  string last = pid.GetName().GetLast();
1023  modified = true;
1024  pid.Reset();
1026  pid.SetConsortium(last);
1027  }
1028  }
1029  }
1030  return modified;
1031 }
1032 
1033 
1035 {
1036  if (m_Regex) delete m_Regex;
1037 }
1038 
1040 {
1041  m_Regex = new CRegexp("\\b" + input + "\\b", CRegexp::fCompile_ignore_case);
1042 }
1043 
1045 {
1046  if (!authors.IsSetNames())
1047  return false;
1048 
1049  bool modified = false;
1050  CAuth_list::TNames &author_names = authors.SetNames();
1051  if (author_names.IsStd()) {
1052  for (auto&& auth_it : author_names.SetStd()) {
1053  CPerson_id &pid = auth_it->SetName();
1054  if (pid.IsName() && pid.GetName().IsSetLast() && m_Regex)
1055  {
1056  string last = pid.GetName().GetLast();
1058  if (m_Regex->NumFound() > 0)
1059  {
1060  modified = true;
1061  pid.Reset();
1063  pid.SetConsortium(last);
1064  }
1065  }
1066  }
1067  }
1068  return modified;
1069 }
1070 
1071 
1073 {
1074  bool modified = false;
1075  if (authors.IsSetAffil()) {
1076  modified |= x_ApplyToCAffil(authors.SetAffil());
1077  }
1078 
1079  if (authors.IsSetNames()) {
1080  CAuth_list::TNames& author_names = authors.SetNames();
1081  switch (author_names.Which()) {
1083  for (auto&& auth_it : author_names.SetStd()) {
1084  if (auth_it->IsSetAffil()) {
1085  modified |= x_ApplyToCAffil(auth_it->SetAffil());
1086  }
1087  }
1088  break;
1089  default:
1090  break;
1091  }
1092  }
1093  return modified;
1094 }
1095 
1096 
1098 {
1099  bool modified = false;
1100  modified |= FixUSAAbbreviationInAffil(affil);
1101  modified |= FixStateAbbreviationsInAffil(affil);
1102  return modified;
1103 }
1104 
1105 
1106 bool CFixCountryCap::x_ApplyToCAffil(CAffil& affil) // FixCapitalizationInCountryString
1107 {
1108  if (!affil.IsStd()) {
1109  return false;
1110  }
1111 
1112  bool modified = false;
1113  auto& std = affil.SetStd();
1114  if (std.IsSetCountry() && !NStr::IsBlank(std.GetCountry())) {
1115 
1116  string country = std.GetCountry();
1117  string result = country;
1118  NStr::ReplaceInPlace (result, " ", " ");
1120 
1127 
1128  if (result != country)
1129  {
1130  modified = true;
1131  std.SetCountry(result);
1132  }
1133  }
1134  return modified;
1135 }
1136 
1137 
1138 bool CFixAffilCap::x_ApplyToCAffil(CAffil& affil) // FixCapsInPubAffilEx
1139 {
1140  if (!affil.IsStd()) {
1141  return false;
1142  }
1143 
1144  bool modified = false;
1145  auto& std = affil.SetStd();
1146  if (std.IsSetAffil() && !NStr::IsBlank(std.GetAffil()))
1147  {
1148  string affil = std.GetAffil();
1149  NStr::ReplaceInPlace (affil, " ", " ");
1152  FixShortWordsInElement(affil);
1158  FixOrdinalNumbers (affil);
1159  if (affil != std.GetAffil())
1160  {
1161  modified = true;
1162  std.SetAffil(affil);
1163  }
1164  }
1165 
1166  if (std.IsSetDiv() && !NStr::IsBlank(std.GetDiv()))
1167  {
1168  string div = std.GetDiv();
1169  NStr::ReplaceInPlace (div, " ", " ");
1178  FixOrdinalNumbers (div);
1179  if (div != std.GetDiv())
1180  {
1181  modified = true;
1182  std.SetDiv(div);
1183  }
1184  }
1185 
1186  if (std.IsSetCity() && !NStr::IsBlank(std.GetCity()))
1187  {
1188  string city = std.GetCity();
1189  NStr::ReplaceInPlace (city, " ", " ");
1192  FixShortWordsInElement(city);
1197  FixOrdinalNumbers (city);
1198  if (city != std.GetCity())
1199  {
1200  modified = true;
1201  std.SetCity(city);
1202  }
1203  }
1204 
1205  if (std.IsSetStreet() && !NStr::IsBlank(std.GetStreet()))
1206  {
1207  string street = std.GetStreet();
1208  NStr::ReplaceInPlace (street, " ", " ");
1209  NStr::TruncateSpacesInPlace (street);
1212  FixShortWordsInElement(street);
1216  FixOrdinalNumbers(street);
1217  if (street != std.GetStreet())
1218  {
1219  modified = true;
1220  std.SetStreet(street);
1221  }
1222  }
1223 
1224  if (std.IsSetCountry() && !NStr::IsBlank(std.GetCountry()))
1225  {
1226  string country = std.GetCountry();
1227  NStr::ReplaceInPlace (country, " ", " ");
1228  NStr::TruncateSpacesInPlace (country);
1230  InsertMissingSpacesAfterNo(country);
1231  FixCapitalizationInElement(country);
1232  FixShortWordsInElement(country);
1233  FixAbbreviationsInElement(country);
1235  if (country != std.GetCountry())
1236  {
1237  modified = true;
1238  std.SetCountry(country);
1239  }
1240  }
1241 
1242  if (std.IsSetSub() && !NStr::IsBlank (std.GetSub()))
1243  {
1244  if (std.IsSetCountry() && NStr::EqualCase (std.GetCountry(), "USA"))
1245  {
1246  string state = std.GetSub();
1247  string result = state;
1248  NStr::ReplaceInPlace (result, " ", " ");
1251  if (result.length() == 2) result = NStr::ToUpper(result);
1252  if (result != state)
1253  {
1254  std.SetSub(result);
1255  modified = true;
1256  }
1257  }
1258  else
1259  {
1260  string sub = std.GetSub();
1261  NStr::ReplaceInPlace (sub, " ", " ");
1267  if (sub != std.GetSub())
1268  {
1269  modified = true;
1270  std.SetSub(sub);
1271  }
1272  }
1273  }
1274  return modified;
1275 }
1276 
1277 
1278 // Removing pubs
1280 {
1281  if (!tse)
1282  return CRef<CCmdComposite>();
1283 
1284  m_tse = tse;
1285  CRef<CCmdComposite> composite(new CCmdComposite(m_Title));
1286  x_ApplyToSeqAndFeat(composite);
1287  return composite;
1288 }
1289 
1291 {
1292  x_ApplyToDescriptors(*(m_tse.GetCompleteSeq_entry()), composite);
1293 
1294  for (CFeat_CI feat_it(m_tse, SAnnotSelector(CSeqFeatData::e_Pub)); feat_it; ++feat_it) {
1295  CRef<CSeq_feat> new_feat(new CSeq_feat());
1296  new_feat->Assign(feat_it->GetOriginalFeature());
1297  CPubdesc& edited_pub = new_feat->SetData().SetPub();
1298  if (x_ApplyToPubdesc(edited_pub)) {
1299  const auto& pubs = edited_pub.GetPub().Get();
1300  if (pubs.empty()) {
1301  CRef<CCmdDelSeq_feat> cmd(new CCmdDelSeq_feat(*feat_it));
1302  composite->AddCommand(*cmd);
1303  }
1304  else {
1305  CRef<CCmdChangeSeq_feat> cmd(new CCmdChangeSeq_feat(*feat_it, *new_feat));
1306  composite->AddCommand(*cmd);
1307  }
1308  }
1309  }
1310 }
1311 
1313 {
1315  if ((*it)->IsPub()) {
1316  const CSeqdesc& orig_desc = **it;
1317  CRef<CSeqdesc> new_desc(new CSeqdesc);
1318  new_desc->Assign(orig_desc);
1319  CPubdesc& edited_pub = new_desc->SetPub();
1320  if (x_ApplyToPubdesc(edited_pub)) {
1321  const auto& pubs = edited_pub.GetPub().Get();
1322  if (pubs.empty()) {
1323  CRef<CCmdDelDesc> cmdDelDesc(new CCmdDelDesc(m_tse.GetScope().GetSeq_entryHandle(se), orig_desc));
1324  composite->AddCommand(*cmdDelDesc);
1325  }
1326  else {
1327  CRef<CCmdChangeSeqdesc> cmd(new CCmdChangeSeqdesc(m_tse.GetScope().GetSeq_entryHandle(se), orig_desc, *new_desc));
1328  composite->AddCommand(*cmd);
1329  }
1330 
1331  }
1332  }
1333  }
1334 
1335  if (se.IsSet()) {
1337  x_ApplyToDescriptors(**it, composite);
1338  }
1339  }
1340 }
1341 
1342 
1344 {
1345  bool modified = false;
1346  auto& pubs = pubdesc.SetPub().Set();
1347  for (CPub_set::TPub::iterator pub_iter = pubs.begin(); pub_iter != pubs.end(); )
1348  {
1349  CPub& pub = **pub_iter;
1350  bool to_delete = false;
1351  switch( pub.Which() ) {
1352  case CPub::e_Gen:
1353  {
1354  const CCit_gen& gen = pub.GetGen();
1355  if ( gen.IsSetCit() && !gen.GetCit().empty() ) {
1356  const string& cit = gen.GetCit();
1357  if (NStr::StartsWith (cit, "unpublished", NStr::eNocase))
1358  {
1359  // Cit-gen.cit = "unpublished"
1360  to_delete = true;
1361  }
1362  }
1363  }
1364  break;
1365  case CPub::e_Article:
1366  {
1367  const CCit_art& art = pub.GetArticle();
1368  if ( art.GetFrom().IsJournal() )
1369  {
1370  const CCit_jour& jour = art.GetFrom().GetJournal();
1371  if ( jour.IsSetImp() )
1372  {
1373  const CImprint& imp = jour.GetImp();
1374  if ( imp.IsSetPrepub() && imp.GetPrepub() != CImprint::ePrepub_in_press)
1375  {
1376  // Cit-art.from.jour.imp.prepub is not 0 or 2
1377  to_delete = true;
1378  }
1379  }
1380  }
1381  if ( art.GetFrom().IsBook() )
1382  {
1383  const CCit_book& book = art.GetFrom().GetBook();
1384  if ( book.IsSetImp() )
1385  {
1386  const CImprint& imp = book.GetImp();
1387  if ( imp.IsSetPrepub() && imp.GetPrepub() != CImprint::ePrepub_in_press)
1388  {
1389  // Cit-art.from.book.imp.prepub is not 0 or 2
1390  to_delete = true;
1391  }
1392  }
1393  }
1394  }
1395  break;
1396  case CPub::e_Book:
1397  {
1398  const CCit_book& book = pub.GetBook();
1399  if ( book.IsSetImp() )
1400  {
1401  const CImprint& imp = book.GetImp();
1402 
1403  if ( imp.IsSetPrepub() && imp.GetPrepub() != CImprint::ePrepub_in_press)
1404  {
1405  // Cit-book where Cit-book.imp.prepub is not 0 or 2
1406  to_delete = true;
1407  }
1408  }
1409  }
1410  break;
1411  case CPub::e_Journal:
1412  {
1413  const CCit_jour& jour = pub.GetJournal();
1414  if ( jour.IsSetImp() )
1415  {
1416  const CImprint& imp = jour.GetImp();
1417 
1418  if ( imp.IsSetPrepub() && imp.GetPrepub() != CImprint::ePrepub_in_press)
1419  {
1420  // Cit-jour where Cit-jour.imp.prepub is not 0 or 2
1421  to_delete = true;
1422  }
1423  }
1424  }
1425  break;
1426  case CPub::e_Man:
1427  {
1428  const CCit_book& book = pub.GetMan().GetCit();
1429  if ( book.IsSetImp() )
1430  {
1431  const CImprint& imp = book.GetImp();
1432 
1433  if ( imp.IsSetPrepub() && imp.GetPrepub() != CImprint::ePrepub_in_press)
1434  {
1435  // Cit-let where Cit-let.imp.prepub is not 0 or 2
1436  to_delete = true;
1437  }
1438 
1439  }
1440  }
1441  break;
1442  default:
1443  break;
1444  }
1445  if (to_delete)
1446  {
1447  modified = true;
1448  pub_iter = pubs.erase(pub_iter);
1449  }
1450  else
1451  ++pub_iter;
1452 
1453  }
1454 
1455  return modified;
1456 }
1457 
1458 
1460 {
1461  bool modified = false;
1462  auto& pubs = pubdesc.SetPub().Set();
1463  for (CPub_set::TPub::iterator pub_iter = pubs.begin(); pub_iter != pubs.end(); )
1464  {
1465  CPub& pub = **pub_iter;
1466  bool to_delete = false;
1467  switch( pub.Which() ) {
1468  case CPub::e_Article:
1469  {
1470  const CCit_art& art = pub.GetArticle();
1471  if ( art.GetFrom().IsJournal() )
1472  {
1473  const CCit_jour& jour = art.GetFrom().GetJournal();
1474  if ( jour.IsSetImp() )
1475  {
1476  const CImprint& imp = jour.GetImp();
1477  if ( imp.IsSetPrepub() && imp.GetPrepub() == CImprint::ePrepub_in_press)
1478  {
1479  to_delete = true;
1480  }
1481  }
1482  }
1483  if ( art.GetFrom().IsBook() )
1484  {
1485  const CCit_book& book = art.GetFrom().GetBook();
1486  if ( book.IsSetImp() )
1487  {
1488  const CImprint& imp = book.GetImp();
1489  if ( imp.IsSetPrepub() && imp.GetPrepub() == CImprint::ePrepub_in_press)
1490  {
1491  to_delete = true;
1492  }
1493  }
1494  }
1495  }
1496  break;
1497  case CPub::e_Book:
1498  {
1499  const CCit_book& book = pub.GetBook();
1500  if ( book.CanGetImp() )
1501  {
1502  const CImprint& imp = book.GetImp();
1503  if ( imp.IsSetPrepub() && imp.GetPrepub() == CImprint::ePrepub_in_press)
1504  {
1505  to_delete = true;
1506  }
1507  }
1508  }
1509  break;
1510  case CPub::e_Journal:
1511  {
1512  const CCit_jour& jour = pub.GetJournal();
1513  if ( jour.IsSetImp() )
1514  {
1515  const CImprint& imp = jour.GetImp();
1516 
1517  if ( imp.IsSetPrepub() && imp.GetPrepub() == CImprint::ePrepub_in_press)
1518  {
1519  to_delete = true;
1520  }
1521  }
1522  }
1523  break;
1524  case CPub::e_Man:
1525  {
1526  const CCit_book& book = pub.GetMan().GetCit();
1527  if ( book.IsSetImp() )
1528  {
1529  const CImprint& imp = book.GetImp();
1530  if ( imp.IsSetPrepub() && imp.GetPrepub() == CImprint::ePrepub_in_press)
1531  {
1532  to_delete = true;
1533  }
1534  }
1535  }
1536  break;
1537  default:
1538  break;
1539  }
1540  if (to_delete)
1541  {
1542  modified = true;
1543  pub_iter = pubs.erase(pub_iter);
1544  }
1545  else
1546  ++pub_iter;
1547  }
1548  return modified;
1549 }
1550 
1551 
1553 {
1554  bool modified = false;
1555  auto& pubs = pubdesc.SetPub().Set();
1556  for (CPub_set::TPub::iterator pub_iter = pubs.begin(); pub_iter != pubs.end(); )
1557  {
1558  CPub& pub = **pub_iter;
1559  bool to_delete = false;
1560  switch( pub.Which() ) {
1561  case CPub::e_Gen:
1562  {
1563  const CCit_gen& gen = pub.GetGen();
1564  if ( gen.IsSetCit() && !gen.GetCit().empty() ) {
1565  const string& cit = gen.GetCit();
1566  if (!NStr::StartsWith (cit, "unpublished", NStr::eNocase))
1567  {
1568  // Cit-gen.cit != "unpublished"
1569  to_delete = true;
1570  }
1571  }
1572  }
1573  break;
1574  case CPub::e_Patent:
1575  to_delete = true;
1576  break;
1577  case CPub::e_Article:
1578  {
1579  const CCit_art& art = pub.GetArticle();
1580  if ( art.GetFrom().IsJournal() )
1581  {
1582  const CCit_jour& jour = art.GetFrom().GetJournal();
1583  if ( jour.IsSetImp() )
1584  {
1585  const CImprint& imp = jour.GetImp();
1586  if ( !imp.IsSetPrepub() )
1587  {
1588  // Cit-art.from.jour.imp.prepub is 0
1589  to_delete = true;
1590  }
1591  }
1592  }
1593  if ( art.GetFrom().IsBook() )
1594  {
1595  const CCit_book& book = art.GetFrom().GetBook();
1596  if ( book.IsSetImp() )
1597  {
1598  const CImprint& imp = book.GetImp();
1599  if ( !imp.IsSetPrepub() )
1600  {
1601  // Cit-art.from.book.imp.prepub is 0
1602  to_delete = true;
1603  }
1604  }
1605  }
1606  }
1607  break;
1608  case CPub::e_Book:
1609  {
1610  const CCit_book& book = pub.GetBook();
1611  if ( book.IsSetImp() )
1612  {
1613  const CImprint& imp = book.GetImp();
1614 
1615  if ( !imp.IsSetPrepub() )
1616  {
1617  // Cit-book where Cit-book.imp.prepub is 0
1618  to_delete = true;
1619  }
1620  }
1621  }
1622  break;
1623  case CPub::e_Journal:
1624  {
1625  const CCit_jour& jour = pub.GetJournal();
1626  if ( jour.IsSetImp() )
1627  {
1628  const CImprint& imp = jour.GetImp();
1629 
1630  if ( !imp.IsSetPrepub() )
1631  {
1632  // Cit-jour where Cit-jour.imp.prepub is 0
1633  to_delete = true;
1634  }
1635  }
1636  }
1637  break;
1638  case CPub::e_Man:
1639  {
1640  const CCit_book& book = pub.GetMan().GetCit();
1641  if ( book.IsSetImp() )
1642  {
1643  const CImprint& imp = book.GetImp();
1644 
1645  if ( !imp.IsSetPrepub() )
1646  {
1647  // Cit-let where Cit-let.imp.prepub is 0
1648  to_delete = true;
1649  }
1650 
1651  }
1652  }
1653  break;
1654  case CPub::e_Pmid:
1655  to_delete = true;
1656  break;
1657  default:
1658  break;
1659  }
1660  if (to_delete)
1661  {
1662  modified = true;
1663  pub_iter = pubs.erase(pub_iter);
1664  }
1665  else
1666  ++pub_iter;
1667  }
1668  return modified;
1669 }
1670 
1671 
1673 {
1674  m_SecondPass = false;
1676 
1677  m_SecondPass = true;
1679 }
1680 
1682 {
1683  bool modified = false;
1684  FOR_EACH_PUB_ON_PUBDESC(pub_iter, pubdesc) {
1685  const CPub& pub = **pub_iter;
1686  string label;
1688  if (!m_SecondPass)
1689  m_collisions[label]++;
1690  else if (m_collisions[label] > 1)
1691  modified = true;
1692  }
1693  return modified;
1694 }
1695 
1697 {
1698  bool modified = false;
1699  auto& pubs = pubdesc.SetPub().Set();
1700  for (auto pub_iter = pubs.begin(); pub_iter != pubs.end(); )
1701  {
1702  if ((*pub_iter)->IsSub())
1703  {
1704  ++pub_iter;
1705  }
1706  else
1707  {
1708  pub_iter = pubs.erase(pub_iter);
1709  modified = true;
1710  }
1711  }
1712  return modified;
1713 }
1714 
1715 
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
CSeq_entry_Handle GetSeqEntryForSeqdesc(CRef< CScope > scope, const CSeqdesc &seq_desc)
@Affil.hpp User-defined methods of the data storage class.
Definition: Affil.hpp:56
@Auth_list.hpp User-defined methods of the data storage class.
Definition: Auth_list.hpp:57
void AddCommand(IEditCommand &command)
virtual bool x_ApplyToCAuth(objects::CAuth_list &authors)
virtual bool x_ApplyToCAuth(objects::CAuth_list &authors)
void Fetch(const string &db, const vector< objects::CSeq_id_Handle > &uids, CNcbiOstream &ostr, const string &retmode="xml")
void SetMaxReturn(int ret_max)
CFeat_CI –.
Definition: feat_ci.hpp:64
virtual bool x_ApplyToCAffil(objects::CAffil &affil)
virtual bool x_ApplyToPubdesc(objects::CPubdesc &pubdesc)
virtual bool x_ApplyToCAuth(objects::CAuth_list &authors)
virtual bool x_ApplyToCAuth(objects::CAuth_list &authors)
virtual bool x_ApplyToCAffil(objects::CAffil &affil)
bool x_FixTitle(string &title)
virtual bool x_ApplyToPubdesc(objects::CPubdesc &pubdesc)
static string s_GetTitle(const objects::CTitle &title)
static void s_SetTitle(objects::CTitle &title, const string &value)
virtual bool x_ApplyToCAffil(objects::CAffil &affil)
CImprint –.
Definition: Imprint.hpp:66
@Name_std.hpp User-defined methods of the data storage class.
Definition: Name_std.hpp:56
CObject –.
Definition: ncbiobj.hpp:180
Definition: Pub.hpp:56
@ eContent
Definition: Pub.hpp:66
bool GetLabel(string *label, ELabelType type=eContent, TLabelFlags flags=0, ELabelVersion version=eLabel_DefaultVersion) const
Concatenate a label for this pub to label.
Definition: Pub.cpp:76
@Pubdesc.hpp User-defined methods of the data storage class.
Definition: Pubdesc.hpp:54
CPubmed_entry –.
CRegexp –.
Definition: regexp.hpp:70
virtual bool x_ApplyToPubdesc(objects::CPubdesc &pubdesc)
void LookUpByPmid(objects::CPub &pub, TEntrezId pmid, bool &modified)
virtual bool x_ApplyToPubdesc(objects::CPubdesc &pubdesc)
virtual bool x_ApplyToCAuth(objects::CAuth_list &authors)
map< string, int > m_collisions
virtual bool x_ApplyToPubdesc(objects::CPubdesc &pubdesc)
virtual void x_ApplyToSeqAndFeat(CCmdComposite *composite)
virtual bool x_ApplyToPubdesc(objects::CPubdesc &pubdesc)
virtual bool x_ApplyToPubdesc(objects::CPubdesc &pubdesc)
virtual bool x_ApplyToPubdesc(objects::CPubdesc &pubdesc)
virtual bool x_ApplyToCAuth(objects::CAuth_list &authors)
bool ApplyToPubdesc(CConstRef< CObject > obj, objects::CSeq_entry_Handle tse, CCmdComposite &composite)
CScope –.
Definition: scope.hpp:92
CSeq_entry_Handle –.
Definition: Seq_entry.hpp:56
CSeq_feat_Handle –.
namespace ncbi::objects::
Definition: Seq_feat.hpp:58
virtual bool x_ApplyToCAuth(objects::CAuth_list &authors)
CSubmit_block –.
Definition: Title.hpp:51
@ eLabel_V1
Traditional GetLabel semantics, modeled on the C Toolkit's PubLabelUnique.
@ fLabel_Unique
Append a unique tag [V1].
virtual bool x_ApplyToCAffil(objects::CAffil &affil)=0
virtual bool x_ApplyToCAuth(objects::CAuth_list &authors)
static string s_CapitalizeInitial(const string &orig)
static bool s_FixInitials(objects::CPerson_id &pid)
void x_ApplyToPubequiv(objects::CPub_equiv &pe, bool &modified)
static void s_FixEtAl(objects::CName_std &name)
virtual bool x_ApplyToCAuth(objects::CAuth_list &authors)=0
static void s_ExtractSuffixFromInitials(objects::CName_std &name)
virtual bool x_ApplyToPubdesc(objects::CPubdesc &pubdesc)
virtual void x_ApplyToSeqSubmit(CCmdComposite *composite)
static bool s_FixInitialsNew(objects::CPerson_id &pid)
CConstRef< objects::CSubmit_block > m_SubmitBlock
void x_ApplyToDescriptors(const objects::CSeq_entry &se, CCmdComposite *composite)
objects::CSeq_entry_Handle m_tse
virtual bool x_ApplyToPubdesc(objects::CPubdesc &pubdesc)=0
virtual void x_ApplyToSeqSubmit(CCmdComposite *composite)
CRef< CCmdComposite > GetCommand(objects::CSeq_entry_Handle tse, CConstRef< objects::CSeq_submit > submit=CConstRef< objects::CSeq_submit >(nullptr))
void x_ApplyToSeqAndFeat(CCmdComposite *composite)
void x_ApplyToDescriptors(const objects::CSeq_entry &se, CCmdComposite *composite)
objects::CSeq_entry_Handle m_tse
virtual void x_ApplyToSeqAndFeat(CCmdComposite *composite)
CRef< CCmdComposite > GetCommand(objects::CSeq_entry_Handle tse)
virtual bool x_ApplyToPubdesc(objects::CPubdesc &pubdesc)=0
void FixAbbreviationsInElement(string &result, bool fix_end_of_sentence=true)
char value[7]
Definition: config.c:431
static CS_COMMAND * cmd
Definition: ct_dynamic.c:26
CChangeUnindexedObjectCommand< objects::CSubmit_block > CChangeSubmitBlockCommand
static void DLIST_NAME() init(DLIST_LIST_TYPE *list)
Definition: dlist.tmpl.h:40
static DLIST_TYPE *DLIST_NAME() first(DLIST_LIST_TYPE *list)
Definition: dlist.tmpl.h:46
static DLIST_TYPE *DLIST_NAME() last(DLIST_LIST_TYPE *list)
Definition: dlist.tmpl.h:51
static auto & FixOrdinalNumbers
static auto & FixCapitalizationInElement
static auto & CapitalizeAfterApostrophe
static auto & FixUSAAbbreviationInAffil
static auto & FixKnownAbbreviationsInElement
static auto & FixShortWordsInElement
static auto & FindReplaceString_CountryFixes
static auto & FixAffiliationShortWordsInElement
static auto & GetStateAbbreviation
static auto & InsertMissingSpacesAfterNo
static auto & FixStateAbbreviationsInAffil
static auto & InsertMissingSpacesAfterCommas
SStrictId_Entrez::TId TEntrezId
TEntrezId type for entrez ids which require the same strictness as TGi.
Definition: ncbimisc.hpp:1041
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
Definition: ncbimisc.hpp:815
#define NON_CONST_ITERATE(Type, Var, Cont)
Non constant version of ITERATE macro.
Definition: ncbimisc.hpp:822
#define ZERO_ENTREZ_ID
Definition: ncbimisc.hpp:1102
#define LOG_POST(message)
This macro is deprecated and it's strongly recomended to move in all projects (except tests) to macro...
Definition: ncbidiag.hpp:226
void Error(CExceptionArgs_Base &args)
Definition: ncbiexpt.hpp:1197
const string & GetMsg(void) const
Get message string.
Definition: ncbiexpt.cpp:461
virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)
Set object to copy of another one.
#define MSerial_AsnText
I/O stream manipulators –.
Definition: serialbase.hpp:696
CSeq_feat_Handle GetSeq_featHandle(const CSeq_feat &feat, EMissing action=eMissing_Default)
Definition: scope.cpp:200
TObjectType * GetPointer(void) const THROWS_NONE
Get pointer,.
Definition: ncbiobj.hpp:1684
CRef< C > Ref(C *object)
Helper functions to get CRef<> and CConstRef<> objects.
Definition: ncbiobj.hpp:2015
void Reset(void)
Reset reference object.
Definition: ncbiobj.hpp:1439
TObjectType * GetPointerOrNull(void) const THROWS_NONE
Get pointer value.
Definition: ncbiobj.hpp:1672
CTempString GetMatch(CTempString str, size_t offset=0, size_t idx=0, TMatch flags=fMatch_default, bool noreturn=false)
Get matching pattern and subpatterns.
Definition: regexp.cpp:182
int NumFound() const
Get number of patterns + subpatterns.
Definition: regexp.hpp:562
@ fCompile_ignore_case
Definition: regexp.hpp:103
@ fMatch_default
Definition: regexp.hpp:127
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
#define kEmptyStr
Definition: ncbistr.hpp:123
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
static bool IsBlank(const CTempString str, SIZE_TYPE pos=0)
Check if a string is blank (has no text).
Definition: ncbistr.cpp:106
#define NPOS
Definition: ncbistr.hpp:133
static void TruncateSpacesInPlace(string &str, ETrunc where=eTrunc_Both)
Truncate spaces in a string (in-place)
Definition: ncbistr.cpp:3197
static bool EqualCase(const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const char *s2)
Case-sensitive equality of a substring with another string.
Definition: ncbistr.hpp:5324
static bool StartsWith(const CTempString str, const CTempString start, ECase use_case=eCase)
Check if a string starts with a specified prefix value.
Definition: ncbistr.hpp:5411
static bool EqualNocase(const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const char *s2)
Case-insensitive equality of a substring with another string.
Definition: ncbistr.hpp:5352
static string & ReplaceInPlace(string &src, const string &search, const string &replace, SIZE_TYPE start_pos=0, SIZE_TYPE max_replace=0, SIZE_TYPE *num_replace=0)
Replace occurrences of a substring within a string.
Definition: ncbistr.cpp:3401
static string & ToUpper(string &str)
Convert string to upper case – string& version.
Definition: ncbistr.cpp:424
const char *const kEmptyCStr
Empty "C" string (points to a '\0').
Definition: ncbistr.cpp:68
@ eTrunc_Begin
Truncate leading spaces only.
Definition: ncbistr.hpp:2240
@ eNocase
Case insensitive compare.
Definition: ncbistr.hpp:1206
static const char label[]
const TDescr & GetDescr(void) const
Get the Descr member data.
Definition: Cit_sub_.hpp:476
void SetBook(TBook &value)
Assign a value to Book data member.
Definition: Cit_proc_.cpp:61
bool IsSetDescr(void) const
description of changes for public view Check if a value has been assigned to Descr data member.
Definition: Cit_sub_.hpp:464
TStd & SetStd(void)
Select the variant.
Definition: Auth_list_.hpp:417
const TCit & GetCit(void) const
Get the Cit member data.
Definition: Cit_let_.hpp:267
bool IsSetAffil(void) const
author affiliation Check if a value has been assigned to Affil data member.
Definition: Auth_list_.hpp:498
bool IsSetAuthors(void) const
Check if a value has been assigned to Authors data member.
Definition: Cit_gen_.hpp:623
bool IsSetAuthors(void) const
authors (ANSI requires) Check if a value has been assigned to Authors data member.
Definition: Cit_art_.hpp:534
void SetTitle(TTitle &value)
Assign a value to Title data member.
Definition: Cit_art_.cpp:210
const TJournal & GetJournal(void) const
Get the variant data.
Definition: Cit_art_.cpp:111
void SetAuthors(TAuthors &value)
Assign a value to Authors data member.
Definition: Cit_pat_.cpp:68
bool IsSetPrepub(void) const
Check if a value has been assigned to Prepub data member.
Definition: Imprint_.hpp:1080
const TFrom & GetFrom(void) const
Get the From member data.
Definition: Cit_art_.hpp:567
bool CanGetImp(void) const
Check if it is safe to call GetImp method.
Definition: Cit_book_.hpp:371
bool IsSetTitle(void) const
title of paper (ANSI requires) Check if a value has been assigned to Title data member.
Definition: Cit_art_.hpp:513
const TTitle & GetTitle(void) const
Get the Title member data.
Definition: Cit_art_.hpp:525
void SetAffil(TAffil &value)
Assign a value to Affil data member.
Definition: Auth_list_.cpp:160
void SetAuthors(TAuthors &value)
Assign a value to Authors data member.
Definition: Cit_art_.cpp:227
bool IsSetImp(void) const
Check if a value has been assigned to Imp data member.
Definition: Cit_jour_.hpp:231
TPrepub GetPrepub(void) const
Get the Prepub member data.
Definition: Imprint_.hpp:1099
void SetAuthors(TAuthors &value)
Assign a value to Authors data member.
Definition: Cit_sub_.cpp:74
list< CRef< C_E > > Tdata
Definition: Title_.hpp:477
const TTitle & GetTitle(void) const
Get the Title member data.
Definition: Cit_gen_.hpp:933
void SetCit(TCit &value)
Assign a value to Cit data member.
Definition: Cit_let_.cpp:70
void SetDescr(const TDescr &value)
Assign a value to Descr data member.
Definition: Cit_sub_.hpp:485
bool IsSetNames(void) const
Check if a value has been assigned to Names data member.
Definition: Auth_list_.hpp:464
bool IsSetTitle(void) const
eg.
Definition: Cit_gen_.hpp:921
void SetNames(TNames &value)
Assign a value to Names data member.
Definition: Auth_list_.cpp:149
void SetAuthors(TAuthors &value)
Assign a value to Authors data member.
Definition: Cit_book_.cpp:93
const TCountry & GetCountry(void) const
Get the Country member data.
Definition: Affil_.hpp:888
void SetTitle(const TTitle &value)
Assign a value to Title data member.
Definition: Cit_gen_.hpp:942
bool IsSetTitle(void) const
Check if a value has been assigned to Title data member.
Definition: Cit_pat_.hpp:656
bool IsBook(void) const
Check if variant Book is selected.
Definition: Cit_art_.hpp:501
const TImp & GetImp(void) const
Get the Imp member data.
Definition: Cit_jour_.hpp:243
void SetTitle(const TTitle &value)
Assign a value to Title data member.
Definition: Cit_pat_.hpp:677
bool IsJournal(void) const
Check if variant Journal is selected.
Definition: Cit_art_.hpp:495
bool IsStd(void) const
Check if variant Std is selected.
Definition: Affil_.hpp:1207
const TImp & GetImp(void) const
Get the Imp member data.
Definition: Cit_book_.hpp:377
const TTitle & GetTitle(void) const
Get the Title member data.
Definition: Cit_pat_.hpp:668
const Tdata & Get(void) const
Get the member data.
Definition: Title_.hpp:781
void SetAuthors(TAuthors &value)
Assign a value to Authors data member.
Definition: Cit_gen_.cpp:64
TStd & SetStd(void)
Select the variant.
Definition: Affil_.cpp:220
E_Choice Which(void) const
Which variant is currently selected.
Definition: Auth_list_.hpp:375
bool IsSetImp(void) const
Check if a value has been assigned to Imp data member.
Definition: Cit_book_.hpp:365
Tdata & Set(void)
Assign a value to data member.
Definition: Title_.hpp:787
bool IsStd(void) const
Check if variant Std is selected.
Definition: Auth_list_.hpp:404
const TBook & GetBook(void) const
Get the variant data.
Definition: Cit_art_.cpp:133
@ e_Ml_jta
specifically MEDLINE jta J
Definition: Title_.hpp:116
@ e_Trans
Title, Translated AJB.
Definition: Title_.hpp:113
@ e_Abr
Title, Abbreviated B.
Definition: Title_.hpp:119
@ e_Issn
ISSN J.
Definition: Title_.hpp:118
@ e_Jta
Title, Abbreviated J.
Definition: Title_.hpp:114
@ e_Tsub
Title, Subordinate A B.
Definition: Title_.hpp:112
@ e_Coden
a coden J
Definition: Title_.hpp:117
@ e_Iso_jta
specifically ISO jta J
Definition: Title_.hpp:115
@ e_Isbn
ISBN B.
Definition: Title_.hpp:120
@ e_Name
Title, Anal,Coll,Mono AJB.
Definition: Title_.hpp:111
@ ePrepub_in_press
accepted, not published
Definition: Imprint_.hpp:96
@ e_Std
full citations
Definition: Auth_list_.hpp:113
bool IsConsortium(void) const
Check if variant Consortium is selected.
Definition: Person_id_.hpp:405
void SetInitials(const TInitials &value)
Assign a value to Initials data member.
Definition: Name_std_.hpp:619
bool IsSetSuffix(void) const
Jr, Sr, III Check if a value has been assigned to Suffix data member.
Definition: Name_std_.hpp:645
const TInitials & GetInitials(void) const
Get the Initials member data.
Definition: Name_std_.hpp:610
bool IsName(void) const
Check if variant Name is selected.
Definition: Person_id_.hpp:359
virtual void Reset(void)
Reset the whole object.
Definition: Person_id_.cpp:52
void SetLast(const TLast &value)
Assign a value to Last data member.
Definition: Name_std_.hpp:431
void SetFirst(const TFirst &value)
Assign a value to First data member.
Definition: Name_std_.hpp:478
bool IsSetInitials(void) const
first + middle initials Check if a value has been assigned to Initials data member.
Definition: Name_std_.hpp:598
TConsortium & SetConsortium(void)
Select the variant.
Definition: Person_id_.hpp:418
bool IsSetLast(void) const
Check if a value has been assigned to Last data member.
Definition: Name_std_.hpp:410
const TSuffix & GetSuffix(void) const
Get the Suffix member data.
Definition: Name_std_.hpp:657
void Select(E_Choice index, EResetVariant reset=eDoResetVariant)
Select the requested variant if needed.
TName & SetName(void)
Select the variant.
Definition: Person_id_.cpp:143
const TFirst & GetFirst(void) const
Get the First member data.
Definition: Name_std_.hpp:469
const TLast & GetLast(void) const
Get the Last member data.
Definition: Name_std_.hpp:422
const TName & GetName(void) const
Get the variant data.
Definition: Person_id_.cpp:137
bool IsSetFirst(void) const
Check if a value has been assigned to First data member.
Definition: Name_std_.hpp:457
void ResetSuffix(void)
Reset Suffix data member.
Definition: Name_std_.cpp:80
@ e_Consortium
consortium name
Definition: Person_id_.hpp:99
TProc & SetProc(void)
Select the variant.
Definition: Pub_.cpp:305
const TMan & GetMan(void) const
Get the variant data.
Definition: Pub_.cpp:365
TBook & SetBook(void)
Select the variant.
Definition: Pub_.cpp:283
const TPmid & GetPmid(void) const
Get the variant data.
Definition: Pub_.hpp:683
const TArticle & GetArticle(void) const
Get the variant data.
Definition: Pub_.cpp:233
const TJournal & GetJournal(void) const
Get the variant data.
Definition: Pub_.cpp:255
const TSub & GetSub(void) const
Get the variant data.
Definition: Pub_.cpp:189
const TPatent & GetPatent(void) const
Get the variant data.
Definition: Pub_.cpp:321
const Tdata & Get(void) const
Get the member data.
Definition: Pub_equiv_.hpp:165
TEquiv & SetEquiv(void)
Select the variant.
Definition: Pub_.cpp:393
E_Choice Which(void) const
Which variant is currently selected.
Definition: Pub_.hpp:555
TMan & SetMan(void)
Select the variant.
Definition: Pub_.cpp:371
TSub & SetSub(void)
Select the variant.
Definition: Pub_.cpp:195
TGen & SetGen(void)
Select the variant.
Definition: Pub_.cpp:173
const TGen & GetGen(void) const
Get the variant data.
Definition: Pub_.cpp:167
TPatent & SetPatent(void)
Select the variant.
Definition: Pub_.cpp:327
TArticle & SetArticle(void)
Select the variant.
Definition: Pub_.cpp:239
const TBook & GetBook(void) const
Get the variant data.
Definition: Pub_.cpp:277
@ e_Pmid
PubMedId.
Definition: Pub_.hpp:114
@ e_Article
Definition: Pub_.hpp:106
@ e_Book
Definition: Pub_.hpp:108
@ e_Gen
general or generic unparsed
Definition: Pub_.hpp:102
@ e_Journal
Definition: Pub_.hpp:107
@ e_Patent
Definition: Pub_.hpp:110
@ e_Proc
proceedings of a meeting
Definition: Pub_.hpp:109
@ e_Equiv
to cite a variety of ways
Definition: Pub_.hpp:113
@ e_Man
manuscript, thesis, or letter
Definition: Pub_.hpp:112
@ e_Sub
submission
Definition: Pub_.hpp:103
void SetData(TData &value)
Assign a value to Data data member.
Definition: Seq_feat_.cpp:94
@ e_Pub
publication applies to this seq
const TSet & GetSet(void) const
Get the variant data.
Definition: Seq_entry_.cpp:124
bool IsSet(void) const
Check if variant Set is selected.
Definition: Seq_entry_.hpp:263
void SetPub(TPub &value)
Assign a value to Pub data member.
Definition: Pubdesc_.cpp:72
TPub & SetPub(void)
Select the variant.
Definition: Seqdesc_.cpp:362
bool IsSetPub(void) const
the citation(s) Check if a value has been assigned to Pub data member.
Definition: Pubdesc_.hpp:593
const TPub & GetPub(void) const
Get the Pub member data.
Definition: Pubdesc_.hpp:605
void SetCit(TCit &value)
Assign a value to Cit data member.
const TSub & GetSub(void) const
Get the Sub member data.
bool IsSetSub(void) const
Check if a value has been assigned to Sub data member.
where boath are integers</td > n< td ></td > n</tr > n< tr > n< td > tse</td > n< td > optional</td > n< td > String</td > n< td class=\"description\"> TSE option controls what blob is orig
static int input()
yy_size_t n
int isalpha(Uchar c)
Definition: ncbictype.hpp:61
int toupper(Uchar c)
Definition: ncbictype.hpp:73
int islower(Uchar c)
Definition: ncbictype.hpp:66
int isupper(Uchar c)
Definition: ncbictype.hpp:70
void copy(Njn::Matrix< S > *matrix_, const Njn::Matrix< T > &matrix0_)
Definition: njn_matrix.hpp:613
static const char * suffix[]
Definition: pcregrep.c:408
#define EDIT_EACH_PUB_ON_PUBEQUIV(Itr, Var)
Definition: pub_macros.hpp:89
#define FOR_EACH_PUB_ON_PUBDESC(Itr, Var)
FOR_EACH_PUB_ON_PUBDESC EDIT_EACH_PUB_ON_PUBDESC.
Definition: pub_macros.hpp:127
#define EDIT_EACH_PUB_ON_PUBDESC(Itr, Var)
Definition: pub_macros.hpp:130
static bool s_FixNameCap(string &name, bool bApostrophes)
static bool s_CleanVisString(string &str)
USING_SCOPE(objects)
#define TRUNCATE_SPACES(o, x)
#define EXTRACTSUFFIXFROMINITIALS(OLD, NEW)
#define CLEAN_STRING_MEMBER(o, x)
string GetFirstInitial(string input, bool skip_rest)
#define FOR_EACH_SEQENTRY_ON_SEQSET(Itr, Var)
FOR_EACH_SEQENTRY_ON_SEQSET EDIT_EACH_SEQENTRY_ON_SEQSET.
#define FOR_EACH_SEQDESC_ON_SEQENTRY(Itr, Var)
FOR_EACH_SEQDESC_ON_SEQENTRY EDIT_EACH_SEQDESC_ON_SEQENTRY.
#define RESET_FIELD(Var, Fld)
RESET_FIELD base macro.
#define GET_MUTABLE(Var, Fld)
GET_MUTABLE base macro.
#define RAW_FIELD_IS_EMPTY_OR_UNSET(Var, Fld)
RAW_FIELD_IS_EMPTY_OR_UNSET macro.
#define FIELD_IS_SET(Var, Fld)
FIELD_IS_SET base macro.
#define FIELD_EQUALS(Var, Fld, Value)
FIELD_EQUALS base macro.
#define GET_FIELD(Var, Fld)
GET_FIELD base macro.
#define SET_FIELD(Var, Fld, Val)
SET_FIELD base macro.
#define GET_STRING_FLD_OR_BLANK(Var, Fld)
GET_STRING_FLD_OR_BLANK base macro.
static const char * str(char *buf, int n)
Definition: stats.c:84
SAnnotSelector –.
#define _ASSERT
else result
Definition: token2.c:20
Modified on Sat Dec 02 09:22:23 2023 by modify_doxy.py rev. 669887