A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://www.ncbi.nlm.nih.gov/IEB/ToolBox/CPP_DOC/doxyhtml/unit__test__macro__util_8cpp_source.html below:

NCBI C++ ToolKit: src/gui/objutils/test_macro/unit_test_macro_util.cpp Source File

75

vector<string> taxnames;

76

taxnames.push_back(

"Banana bunchy top virus"

);

77

taxnames.push_back(

"Escherichia coli"

);

78  string

orig_prot(

"Banana Bunchy Top Virus Coat Protein"

);

80

BOOST_CHECK_EQUAL(new_prot,

"Coat Protein"

);

82

orig_prot.assign(

"Coat protein (Banana buncHY Top virus)"

);

84

BOOST_CHECK_EQUAL(new_prot,

"Coat protein"

);

86

orig_prot.assign(

"Coat protein [Banana bunchy top VIRUS] gene"

);

88

BOOST_CHECK_EQUAL(new_prot,

"Coat protein gene"

);

93  string text

=

"Drs3 isolate and DrS3 and DRS3"

;

94  string

find =

"Drs3"

;

95  string

replace =

"ssss"

;

96  bool

case_sens =

false

;

97  bool

is_regex =

false

;

99

BOOST_CHECK_EQUAL(res,

true

);

100

BOOST_CHECK_EQUAL(

text

,

"ssss isolate and ssss and ssss"

);

102  text

=

"Drs3 isolate and DrS3 and Drs3"

;

105

BOOST_CHECK_EQUAL(res,

true

);

106

BOOST_CHECK_EQUAL(

text

,

"ssss isolate and DrS3 and ssss"

);

108  text

=

"Putative terminase"

;

110

replace =

"putative"

;

113

BOOST_CHECK_EQUAL(res,

true

);

114

BOOST_CHECK_EQUAL(

text

,

"putative terminase"

);

116  text

=

"llumina technology"

;

118

replace =

"Illumina"

;

121

BOOST_CHECK_EQUAL(res,

true

);

122

BOOST_CHECK_EQUAL(

text

,

"Illumina technology"

);

124  text

=

"some isolate"

;

129

BOOST_CHECK_EQUAL(res,

true

);

130

BOOST_CHECK_EQUAL(

text

,

"some"

);

132  text

=

"some isolate"

;

137

BOOST_CHECK_EQUAL(res,

false

);

138

BOOST_CHECK_EQUAL(

text

,

"some isolate"

);

145

BOOST_CHECK_EQUAL(res,

false

);

148  text

=

"Bubalus bubalis"

;

153

BOOST_CHECK_EQUAL(res,

true

);

154

BOOST_CHECK_EQUAL(

text

,

"Butestlus butestlis"

);

160

name.

SetLast

(

"Sotomayor-Gonzalez"

);

164

BOOST_CHECK_EQUAL(name.

GetFirst

(),

"Alicia"

);

170

BOOST_CHECK_EQUAL(name.

GetFirst

(),

"Alicia"

);

176

BOOST_CHECK_EQUAL(name.

GetFirst

(),

"Alicia Carmen"

);

182

BOOST_CHECK_EQUAL(name.

GetFirst

(),

"Alicia Carmen"

);

188

BOOST_CHECK_EQUAL(name.

GetFirst

(),

"Alicia Carmen Ana"

);

189

BOOST_CHECK_EQUAL(name.

GetInitials

(),

"A.C.A."

);

194

BOOST_CHECK_EQUAL(name.

GetFirst

(),

"Maria Elena"

);

197

name.

SetFirst

(

"Maria del Carmen"

);

200

BOOST_CHECK_EQUAL(name.

GetFirst

(),

"Maria del Carmen"

);

206

BOOST_CHECK_EQUAL(name.

GetFirst

(),

"Maria da Luz"

);

207

BOOST_CHECK_EQUAL(name.

GetInitials

(),

"M.d.L."

);

209

name.

SetFirst

(

"Eloiza Lopes de Lira"

);

212

BOOST_CHECK_EQUAL(name.

GetFirst

(),

"Eloiza Lopes de Lira"

);

213

BOOST_CHECK_EQUAL(name.

GetInitials

(),

"E.Ld.L."

);

215

name.

SetFirst

(

"Eloiza Lopes De Lira"

);

218

BOOST_CHECK_EQUAL(name.

GetFirst

(),

"Eloiza Lopes De Lira"

);

219

BOOST_CHECK_EQUAL(name.

GetInitials

(),

"E.L.D.L."

);

221

name.

SetFirst

(

"Eloiza Lopes de Lira"

);

224

BOOST_CHECK_EQUAL(name.

GetFirst

(),

"Eloiza Lopes de Lira"

);

225

BOOST_CHECK_EQUAL(name.

GetInitials

(),

"E.Ld.L.A."

);

227

name.

SetFirst

(

"Eloiza Lopes De Lira"

);

230

BOOST_CHECK_EQUAL(name.

GetFirst

(),

"Eloiza Lopes De Lira"

);

231

BOOST_CHECK_EQUAL(name.

GetInitials

(),

"E.L.D.L.A."

);

233

name.

SetFirst

(

"Eloiza Lopes de Lira"

);

236

BOOST_CHECK_EQUAL(name.

GetFirst

(),

"Eloiza Lopes de Lira Ana"

);

237

BOOST_CHECK_EQUAL(name.

GetInitials

(),

"E.Ld.L.A."

);

239

name.

SetFirst

(

"Eloiza Lopes de Lira"

);

242

BOOST_CHECK_EQUAL(name.

GetFirst

(),

"Eloiza Lopes de Lira Ana"

);

243

BOOST_CHECK_EQUAL(name.

GetInitials

(),

"E.Ld.L.A."

);

248

BOOST_CHECK_EQUAL(name.

GetFirst

(),

"Wei Ning"

);

254

BOOST_CHECK_EQUAL(name.

GetFirst

(),

"Wei Ning Ning"

);

255

BOOST_CHECK_EQUAL(name.

GetInitials

(),

"W.N.N."

);

260

BOOST_CHECK_EQUAL(name.

GetFirst

(),

"J Jiage"

);

266

BOOST_CHECK_EQUAL(name.

GetFirst

(),

"Lei"

);

272

BOOST_CHECK_EQUAL(name.

GetFirst

(),

"Z"

);

278

BOOST_CHECK_EQUAL(name.

GetFirst

(),

"Z A"

);

284

BOOST_CHECK_EQUAL(name.

GetFirst

(),

"Z Ning"

);

303

BOOST_CHECK_EQUAL(name.

GetInitials

(),

"X.A.-S."

);

307

BOOST_CHECK_EQUAL(name.

GetInitials

(),

"X.A.-S."

);

311

BOOST_CHECK_EQUAL(name.

GetInitials

(),

"X.A.S."

);

315

BOOST_CHECK_EQUAL(name.

GetInitials

(),

"X.A.S."

);

324

BOOST_CHECK_EQUAL(name.

GetInitials

(),

"Wb.A.S."

);

330

stdname.

SetLast

(

"Freitas"

);

342

BOOST_CHECK_EQUAL(stdname.

GetInitials

(),

"T.M."

);

346

BOOST_CHECK_EQUAL(stdname.

GetInitials

(),

"T.M.S."

);

356

BOOST_CHECK_EQUAL(stdname.

GetInitials

(),

"R.A.S."

);

360

BOOST_CHECK_EQUAL(stdname.

GetInitials

(),

"R.A.S."

);

364

BOOST_CHECK_EQUAL(stdname.

GetInitials

(),

"R.A.S."

);

368

BOOST_CHECK_EQUAL(stdname.

GetInitials

(),

"R.A.S."

);

372

BOOST_CHECK_EQUAL(stdname.

GetInitials

(),

"R.A.-S."

);

376

BOOST_CHECK_EQUAL(stdname.

GetInitials

(),

"R.A.-S."

);

380

BOOST_CHECK_EQUAL(stdname.

GetInitials

(),

"R.A.S."

);

382

stdname.

SetFirst

(

"Maria del Carmen"

);

385

BOOST_CHECK_EQUAL(stdname.

GetInitials

(),

"Md.C.A."

);

390

BOOST_CHECK_EQUAL(stdname.

GetInitials

(),

"Wb."

);

399

firstname =

"Robert"

;

402

firstname =

"Robert Alvarez"

;

405

firstname =

"Robert-Alvarez"

;

408

firstname =

"Robert-alvarez"

;

411

firstname =

"Robert alvarez"

;

414

firstname =

"Robert Alvarez Santos"

;

417

firstname =

"Robert Alvarez-Santos"

;

420

firstname =

"Robert-Alvarez-Santos"

;

423

firstname =

"Robert Alvarez-santos"

;

426

firstname =

"Robert-alvarez santos"

;

429

firstname =

"Maria del Carmen"

;

432

firstname =

"Maria de los Angeles"

;

435

firstname =

"Maria de los"

;

438

firstname =

"Maria de La Luz"

;

446  string

lastname =

"Freitas"

;

447  string

firstname =

"Robert"

;

452

BOOST_CHECK_EQUAL(

MakeAsn

(stdname),

454  " last \"Freitas\",\n" 455  " first \"Robert\",\n" 462

BOOST_CHECK_EQUAL(

MakeAsn

(stdname),

464  " last \"Freitas\",\n" 465  " first \"Robert\",\n" 466  " initials \"R.A.\"\n" 470

mid_initials =

"Alvarez Santos"

;

472

BOOST_CHECK_EQUAL(

MakeAsn

(stdname),

474  " last \"Freitas\",\n" 475  " first \"Robert\",\n" 476  " initials \"R.A.S.\"\n" 480

mid_initials =

"AS"

;

482

BOOST_CHECK_EQUAL(

MakeAsn

(stdname),

484  " last \"Freitas\",\n" 485  " first \"Robert\",\n" 486  " initials \"R.A.S.\"\n" 490

mid_initials =

"Alvarez-Santos"

;

492

BOOST_CHECK_EQUAL(

MakeAsn

(stdname),

494  " last \"Freitas\",\n" 495  " first \"Robert\",\n" 496  " initials \"R.A.-S.\"\n" 500

mid_initials =

"Alvarez-santos"

;

502

BOOST_CHECK_EQUAL(

MakeAsn

(stdname),

504  " last \"Freitas\",\n" 505  " first \"Robert\",\n" 506  " initials \"R.A.-S.\"\n" 510

mid_initials.clear();

511

firstname =

"Robert Alvarez Santos"

;

513

BOOST_CHECK_EQUAL(

MakeAsn

(stdname),

515  " last \"Freitas\",\n" 516  " first \"Robert Alvarez Santos\",\n" 517  " initials \"R.A.S.\"\n" 521

firstname =

"Robert Alvarez-Santos"

;

523

BOOST_CHECK_EQUAL(

MakeAsn

(stdname),

525  " last \"Freitas\",\n" 526  " first \"Robert Alvarez-Santos\",\n" 527  " initials \"R.A.-S.\"\n" 531

firstname =

"Robert Alvarez santos"

;

533

BOOST_CHECK_EQUAL(

MakeAsn

(stdname),

535  " last \"Freitas\",\n" 536  " first \"Robert Alvarez santos\",\n" 537  " initials \"R.As.\"\n" 541

firstname =

"Robert Alvarez-santos"

;

543

BOOST_CHECK_EQUAL(

MakeAsn

(stdname),

545  " last \"Freitas\",\n" 546  " first \"Robert Alvarez-santos\",\n" 547  " initials \"R.A.-s.\"\n" 551

mid_initials =

"Jose"

;

553

BOOST_CHECK_EQUAL(

MakeAsn

(stdname),

555  " last \"Freitas\",\n" 556  " first \"Robert Alvarez-santos\",\n" 557  " initials \"R.A.-s.J.\"\n" 561

mid_initials =

"Jose"

;

562

firstname =

"Robert Alvarez Santos"

;

564

BOOST_CHECK_EQUAL(

MakeAsn

(stdname),

566  " last \"Freitas\",\n" 567  " first \"Robert Alvarez Santos\",\n" 568  " initials \"R.A.S.J.\"\n" 572

mid_initials.clear();

573

firstname =

"Maria del Carmen"

;

575

BOOST_CHECK_EQUAL(

MakeAsn

(stdname),

577  " last \"Freitas\",\n" 578  " first \"Maria del Carmen\",\n" 579  " initials \"Md.C.\"\n" 583

mid_initials =

"Anna"

;

585

BOOST_CHECK_EQUAL(

MakeAsn

(stdname),

587  " last \"Freitas\",\n" 588  " first \"Maria del Carmen\",\n" 589  " initials \"Md.C.A.\"\n" 593

mid_initials.clear();

594

firstname =

"Maria de los Angeles"

;

596

BOOST_CHECK_EQUAL(

MakeAsn

(stdname),

598  " last \"Freitas\",\n" 599  " first \"Maria de los Angeles\",\n" 600  " initials \"Mdl.A.\"\n" 605

firstname =

"Maria de los Angeles"

;

607

BOOST_CHECK_EQUAL(

MakeAsn

(stdname),

609  " last \"Freitas\",\n" 610  " first \"Maria de los Angeles\",\n" 611  " initials \"Mdl.A.A.\"\n" 615

mid_initials.clear();

616

firstname =

"Maria de La Luz"

;

618

BOOST_CHECK_EQUAL(

MakeAsn

(stdname),

620  " last \"Freitas\",\n" 621  " first \"Maria de La Luz\",\n" 622  " initials \"Md.L.L.\"\n" 626

firstname =

"Maria de los"

;

628

BOOST_CHECK_EQUAL(

MakeAsn

(stdname),

630  " last \"Freitas\",\n" 631  " first \"Maria de los\",\n" 632  " initials \"Mdl.\"\n" 638

BOOST_CHECK_EQUAL(

MakeAsn

(stdname),

640  " last \"Freitas\"\n" 649

stdname.

SetLast

(

"Freitas"

);

650

BOOST_TEST_MESSAGE(

"Apply middle initial to a name with a last name:"

);

652

BOOST_TEST_MESSAGE(

"when the first name and initials fields are not set"

);

659

BOOST_TEST_MESSAGE(

"and a first name and the initials field is not set"

);

665

BOOST_TEST_MESSAGE(

"and a first name and the first initial is set (replace old)"

);

671

BOOST_TEST_MESSAGE(

"and a first name and the first initial is set (append with no delimiter)"

);

677

BOOST_TEST_MESSAGE(

"and a first name and a middle initial"

);

683

BOOST_TEST_MESSAGE(

"and a first name and two middle initials"

);

693

BOOST_TEST_MESSAGE(

"with no first name and a middle initial"

);

699

BOOST_TEST_MESSAGE(

"with no first name and a middle initial (leave old)"

);

705

BOOST_TEST_MESSAGE(

"with no first name and a middle initial (cancel)"

);

714

stdname.

SetLast

(

"Freitas"

);

715

BOOST_TEST_MESSAGE(

"Dot at the end of the new value will be silenced"

);

755

stdname.

SetLast

(

"Benites"

);

756

BOOST_TEST_MESSAGE(

"Apply first name to a name with a last name:"

);

758

BOOST_TEST_MESSAGE(

"when the first name and initials fields are not set"

);

760

BOOST_CHECK(stdname.

GetFirst

() ==

"Maria"

);

765

BOOST_TEST_MESSAGE(

"when the first name is not set but the initials fields is set"

);

767

BOOST_CHECK(stdname.

GetFirst

() ==

"Adam"

);

772

BOOST_TEST_MESSAGE(

"when the first name is not set but the initials fields is set"

);

774

BOOST_CHECK(stdname.

GetFirst

() ==

"Maria"

);

779

BOOST_TEST_MESSAGE(

"when there is a first name but the initials fields is not set"

);

781

BOOST_CHECK(stdname.

GetFirst

() ==

"Maria"

);

788

BOOST_CHECK(stdname.

GetFirst

() ==

"Adam Marc"

);

793

BOOST_TEST_MESSAGE(

"when there is a first name and no middle initial"

);

795

BOOST_CHECK(stdname.

GetFirst

() ==

"Marc"

);

800

BOOST_TEST_MESSAGE(

"when there is a first name and there is a middle initial"

);

802

BOOST_CHECK(stdname.

GetFirst

() ==

"Marc"

);

807

BOOST_TEST_MESSAGE(

"when there is a first name and there is a middle initial"

);

809

BOOST_CHECK(stdname.

GetFirst

() ==

"Marc"

);

815

BOOST_CHECK(stdname.

GetFirst

() ==

"Adam Marc"

);

822

stdname.

SetLast

(

"Freitas"

);

823

BOOST_TEST_MESSAGE(

"Remove middle initial from a name with a last name:"

);

827

BOOST_TEST_MESSAGE(

"when the first name and initials fields are not set"

);

832

BOOST_TEST_MESSAGE(

"with no first name and a middle initial"

);

840

BOOST_TEST_MESSAGE(

"and a first name and the initials field is not set"

);

846

BOOST_TEST_MESSAGE(

"and a first name and the initials field is set"

);

852

BOOST_TEST_MESSAGE(

"and a first name and a middle initial"

);

858

BOOST_TEST_MESSAGE(

"and a first name and multiple middle initials"

);

868

stdname.

SetLast

(

"Freitas"

);

869

BOOST_TEST_MESSAGE(

"Remove first name from a name with a last name:"

);

873

BOOST_TEST_MESSAGE(

"Remove first name when there is a first name:"

);

902

stdname.

SetFirst

(

"Maria de La Luz"

);

908

stdname.

SetFirst

(

"Maria de La Luz"

);

920

BOOST_TEST_MESSAGE(

"Reverse names when the first name is missing"

);

925

BOOST_CHECK_EQUAL(

MakeAsn

(name),

927  " last \"Albert\",\n" 928  " first \"Freitas\"\n" 935

BOOST_CHECK_EQUAL(

MakeAsn

(name),

937  " last \"Albert\",\n" 938  " first \"Freitas\",\n" 946

BOOST_CHECK_EQUAL(

MakeAsn

(name),

948  " last \"Albert Bela\",\n" 949  " first \"Freitas\",\n" 957

BOOST_CHECK_EQUAL(

MakeAsn

(name),

959  " last \"Albert Bela\",\n" 960  " first \"Freitas\",\n" 968

BOOST_CHECK_EQUAL(

MakeAsn

(name),

970  " last \"Albert\",\n" 971  " first \"Freitas\",\n" 972  " initials \"F.G.\"\n" 979

BOOST_CHECK_EQUAL(

MakeAsn

(name),

981  " last \"Albert\",\n" 982  " first \"Freitas\",\n" 983  " initials \"F.G.\"\n" 990

BOOST_CHECK_EQUAL(

MakeAsn

(name),

992  " last \"Albert Bela\",\n" 993  " first \"Freitas\",\n" 994  " initials \"F.G.\"\n" 1001

BOOST_CHECK_EQUAL(

MakeAsn

(name),

1003  " last \"Albert Bela\",\n" 1004  " first \"Freitas\",\n" 1005  " initials \"F.B.R.\"\n" 1010

name.

SetFirst

(

"Maria de La Luz"

);

1013

BOOST_CHECK_EQUAL(

MakeAsn

(name),

1015  " last \"Maria de La Luz\",\n" 1016  " first \"Freitas\"\n" 1020

name.

SetFirst

(

"Maria de La Luz"

);

1023

BOOST_CHECK_EQUAL(

MakeAsn

(name),

1025  " last \"Maria de La Luz\",\n" 1026  " first \"Freitas\",\n" 1027  " initials \"F.A.\"\n" 1032

name.

SetFirst

(

"Maria de La Luz"

);

1035

BOOST_CHECK_EQUAL(

MakeAsn

(name),

1037  " last \"Maria de La Luz\",\n" 1038  " first \"Freitas\",\n" 1039  " initials \"F.A.\"\n" 1043

name.

SetFirst

(

"Maria de La Luz"

);

1046

BOOST_CHECK_EQUAL(

MakeAsn

(name),

1048  " last \"Maria de La Luz\",\n" 1049  " first \"Freitas\",\n" 1050  " initials \"F.\"\n" 1054

name.

SetFirst

(

"Maria de La Luz"

);

1057

BOOST_CHECK_EQUAL(

MakeAsn

(name),

1059  " last \"Maria de La Luz\",\n" 1060  " first \"Freitas\",\n" 1061  " initials \"F.A.\"\n" 1064

name.

SetLast

(

"Maria de La Luz"

);

1068

BOOST_CHECK_EQUAL(

MakeAsn

(name),

1070  " last \"Freitas\",\n" 1071  " first \"Maria de La Luz\",\n" 1072  " initials \"Md.L.L.\"\n" 1075

name.

SetLast

(

"Maria de los"

);

1079

BOOST_CHECK_EQUAL(

MakeAsn

(name),

1081  " last \"Freitas\",\n" 1082  " first \"Maria de los\",\n" 1083  " initials \"Mdl.C.\"\n" 1094

authors =

"Jeffrey M. Lorch"

;

1096

BOOST_CHECK_EQUAL(

MakeAsn

(auth_list),

1101  " last \"Lorch\",\n" 1102  " first \"Jeffrey\",\n" 1103  " initials \"J.M.\"\n" 1110

authors =

"Jeffrey M. Lorch, Jonathan M. Palmer"

;

1112

BOOST_CHECK_EQUAL(

MakeAsn

(auth_list),

1117  " last \"Lorch\",\n" 1118  " first \"Jeffrey\",\n" 1119  " initials \"J.M.\"\n" 1124  " last \"Palmer\",\n" 1125  " first \"Jonathan\",\n" 1126  " initials \"J.M.\"\n" 1133

authors =

"Anne Ballmann, George, Kathryn Griffin Jr., Susan Knowles Maria, "

;

1135

BOOST_CHECK_EQUAL(

MakeAsn

(auth_list),

1140  " last \"Ballmann\",\n" 1141  " first \"Anne\",\n" 1142  " initials \"A.\"\n" 1147  " last \"George\"\n" 1153  " first \"Kathryn\",\n" 1154  " initials \"K.G.\"\n" 1159  " last \"Maria\",\n" 1160  " first \"Susan\",\n" 1161  " initials \"S.K.\"\n" 1176  str

=

"apple, orange"

;

1179  str

=

"apple \"orange\""

;

1182  str

=

"apple, \"pear"

;

1185  str

=

"apple\npear"

;

1192

BOOST_CHECK(

str

.empty());

1197

BOOST_CHECK(

str

==

"integron"

);

1202

BOOST_CHECK(

str

==

"name"

);

1207

BOOST_CHECK(

str

==

"other:name"

);

1213

BOOST_CHECK(

str

.empty());

1216

BOOST_CHECK(

str

==

"apple"

);

1223

macro::CMacroRep* macro_rep = engine.

Parse

(macro);

1224

BOOST_CHECK(macro_rep);

1226

cout <<

"Parsing failed for macro:\n"

<< macro << endl;

1230

vector<CRef<CMacroRep>> macros;

1231

macros.push_back(

Ref

(macro_rep));

1233

BOOST_REQUIRE(syn_files.size() == 1);

1234

BOOST_CHECK(syn_files[0] == syn_file);

1246  "MACRO Macro_name \"Description\"\n" 1248  "new_value = \"walnut\"\n" 1249  "existing_text = \"eReplace\"\n" 1250  "contains1 = \"walnut\"\n" 1252  "FOR EACH BioSource\n" 1253  "WHERE CONTAINS(\"org.taxname\", contains1, true, false, false, false, false, \"local_synfile.txt\", match1, true, false, contains1, false, true)\n" 1255  "obj = Resolve(\"org.orgname.mod\") WHERE obj.subtype = \"acronym\"; \n" 1256  "SetModifier(obj, \"org.orgname.mod\", \"acronym\", new_value, existing_text);\n" 1264  "MACRO Macro_name \"Description\"\n" 1266  "match = \"taxon\"\n" 1267  "case_sensitive = false\n" 1268  "ignore_space = true\n" 1269  "ignore_punctuation = true\n" 1270  "FOR EACH Cdregion\n" 1272  "obj = Resolve(\"dbxref\") WHERE STARTS(\"obj.db\", match, case_sensitive, ignore_space, ignore_punctuation, \"synonyms.txt\", match);\n" 1273  "RemoveQual(obj);\n" 1281  "MACRO Macro_name \"Description\"\n" 1283  "match = \"taxon\"\n" 1284  "case_sensitive = false\n" 1285  "ignore_space = true\n" 1286  "ignore_punctuation = true\n" 1287  "FOR EACH Cdregion\n" 1289  "obj = Resolve(\"dbxref\") WHERE STARTS(\"obj.db\", match, \"synonyms.txt\", match, \"apple\");\n" 1290  "RemoveQual(obj);\n" 1298  "MACRO Macro_name \"Description\"\n" 1300  "match = \"taxon\"\n" 1301  "case_sensitive = false\n" 1302  "ignore_space = true\n" 1303  "ignore_punctuation = true\n" 1304  "FOR EACH Cdregion\n" 1306  "obj = Resolve(\"dbxref\") WHERE STARTS(\"obj.db\", match, \"local_synfile.txt\", match, \"apple\");\n" 1307  "RemoveQual(obj);\n" 1315  "MACRO Macro_name \"Description\"\n" 1317  "new_value = \"Homo sapiens\"\n" 1318  "match = \"taxon\"\n" 1319  "case_sensitive = false\n" 1320  "ignore_space = true\n" 1321  "ignore_punctuation = true\n" 1322  "FOR EACH BioSource\n" 1323  "WHERE EQUALS(\"subtype\", \"isolation-source\", new_value, true, \"synonyms.txt\", new_value)\n" 1325  "RemoveQual(\"org.common\");\n" 1333  "MACRO Macro_name \"Description\"\n" 1335  "new_value = \"Homo sapiens\"\n" 1336  "match = \"taxon\"\n" 1337  "case_sensitive = false\n" 1338  "ignore_space = true\n" 1339  "ignore_punctuation = true\n" 1340  "FOR EACH BioSource\n" 1341  "WHERE EQUALS(\"subtype\", \"isolation-source\", new_value, true, \"local_synfile.txt\", new_value)\n" 1343  "RemoveQual(\"org.common\");\n" 1351  "MACRO Macro_name \"Description\"\n" 1354  "FOR EACH Pubdesc\n" 1356  "obj = PUB_AFFIL(\"affil\") WHERE EQUALS(obj, match, \"synonyms.txt\", match);\n" 1357  "RemoveQual(obj);\n" 1365  "MACRO Macro_name \"Description\"\n" 1368  "FOR EACH Pubdesc\n" 1370  "obj = PUB_AFFIL(\"affil\") WHERE EQUALS(obj, match, \"local_synfile.txt\", match);\n" 1371  "RemoveQual(obj);\n" 1379  "MACRO Macro_name \"Description\"\n" 1382  "FOR EACH Pubdesc\n" 1384  "obj = PUB_AFFIL(\"affil\") WHERE EQUALS(obj, match, true);\n" 1385  "RemoveQual(obj);\n" 1388

macro::CMacroRep* macro_rep = engine.

Parse

(macro);

1389

BOOST_CHECK(macro_rep);

1391

vector<CRef<CMacroRep>> macros;

1392

macros.push_back(

Ref

(macro_rep));

1394

BOOST_CHECK(syn_files.empty());

1399  "MACRO Macro_name \"Description\"\n" 1402  "FOR EACH Pubdesc\n" 1404  "obj = PUB_AFFIL(\"affil\") WHERE CONTAINS(obj, match);\n" 1405  "RemoveQual(obj);\n" 1408

macro::CMacroRep* macro_rep = engine.

Parse

(macro);

1409

BOOST_CHECK(macro_rep);

1411

vector<CRef<CMacroRep>> macros;

1412

macros.push_back(

Ref

(macro_rep));

1414

BOOST_CHECK(syn_files.empty());

1419  "MACRO Macro_name \"Description\"\n" 1421  "match1 = \"synonym02-DSM\"\n" 1422  "match2 = \"test\"\n" 1423  "case_sensitive = false\n" 1424  "ignore_spaces = true\n" 1425  "ignore_punctuation = true\n" 1426  "include_left = true\n" 1427  "include_right = false\n" 1428  "case_sens_parse = true\n" 1429  "whole_word = false\n" 1430  "cap_change = \"none\"\n" 1431  "existing_text = \"eReplace\"\n" 1432  "find_text = \"find\"\n" 1433  "FOR EACH BioSource\n" 1435  "src = Resolve(\"org.orgname.mod\") WHERE src.subtype = \"strain\" AND \n" 1436  "NOT EQUALS(\"src.subname\", \"DSM\", \"synonyms.txt\", match1) AND \n" 1437  "NOT CONTAINS(\"src.subname\", \",\") AND \n" 1438  "NOT CONTAINS(\"src.subname\", \"CBS\", case_sensitive, ignore_spaces, ignore_punctuation, \"synonyms.txt\", match2) AND \n" 1439  "STARTS(\"src.subname\", find_text, case_sensitive, ignore_spaces, ignore_punctuation, \"synonyms.txt\", \"DSMZ\");\n" 1440  "text = ParsedText(\"src.subname\", find_text, include_left, \"repl\", include_right, case_sens_parse, whole_word);\n" 1441  "AddParsedText(text, \"culture-collection\", cap_change, existing_text); \n" 1449  "MACRO Macro_name \"Description\"\n" 1451  "match1 = \"synonym02-DSM\"\n" 1452  "match2 = \"test\"\n" 1453  "case_sensitive = false\n" 1454  "ignore_spaces = true\n" 1455  "ignore_punctuation = true\n" 1456  "include_left = true\n" 1457  "include_right = false\n" 1458  "case_sens_parse = true\n" 1459  "whole_word = false\n" 1460  "cap_change = \"none\"\n" 1461  "existing_text = \"eReplace\"\n" 1462  "find_text = \"find\"\n" 1463  "FOR EACH BioSource\n" 1465  "src = Resolve(\"org.orgname.mod\") WHERE src.subtype = \"strain\" AND \n" 1466  "NOT EQUALS(\"src.subname\", \"DSM\", \"local_synfile.txt\", match1) AND \n" 1467  "NOT CONTAINS(\"src.subname\", \",\") AND \n" 1468  "NOT CONTAINS(\"src.subname\", \"CBS\", case_sensitive, ignore_spaces, ignore_punctuation, \"local_synfile.txt\", match2) AND \n" 1469  "STARTS(\"src.subname\", find_text, case_sensitive, ignore_spaces, ignore_punctuation, \"local_synfile.txt\", \"DSMZ\");\n" 1470  "text = ParsedText(\"src.subname\", find_text, include_left, \"repl\", include_right, case_sens_parse, whole_word);\n" 1471  "AddParsedText(text, \"culture-collection\", cap_change, existing_text); \n" 1479  "MACRO Macro_name \"Description\"\n" 1481  "match1 = \"synonym02-DSM\"\n" 1482  "match2 = \"test\"\n" 1483  "case_sensitive = false\n" 1484  "ignore_spaces = true\n" 1485  "ignore_punctuation = true\n" 1486  "include_left = true\n" 1487  "include_right = false\n" 1488  "case_sens_parse = true\n" 1489  "whole_word = false\n" 1490  "cap_change = \"none\"\n" 1491  "existing_text = \"eReplace\"\n" 1492  "find_text = \"find\"\n" 1493  "FOR EACH BioSource\n" 1495  "src = Resolve(\"org.orgname.mod\") WHERE src.subtype = \"strain\" AND \n" 1496  "NOT EQUALS(\"src.subname\", \"DSM\", \"synonyms.txt\", match1) AND \n" 1497  "NOT CONTAINS(\"src.subname\", \",\") AND \n" 1498  "NOT CONTAINS(\"src.subname\", \"CBS\", case_sensitive, ignore_spaces, ignore_punctuation, \"local_synfile.txt\", match2) AND \n" 1499  "STARTS(\"src.subname\", find_text, case_sensitive, ignore_spaces, ignore_punctuation, \"local_synfile.txt\", \"DSMZ\");\n" 1500  "text = ParsedText(\"src.subname\", find_text, include_left, \"repl\", include_right, case_sens_parse, whole_word);\n" 1501  "AddParsedText(text, \"culture-collection\", cap_change, existing_text); \n" 1504

macro::CMacroRep* macro_rep = engine.

Parse

(macro);

1505

BOOST_CHECK(macro_rep);

1507

cout <<

"Parsing failed for macro:\n"

<< macro << endl;

1511

vector<CRef<CMacroRep>> macros;

1512

macros.push_back(

Ref

(macro_rep));

1514

BOOST_REQUIRE(syn_files.size() == 2);

1515  sort

(syn_files.begin(), syn_files.end());

1516

BOOST_CHECK(syn_files[0] ==

"local_synfile.txt"

);

1517

BOOST_CHECK(syn_files[1] ==

"synonyms.txt"

);

@Auth_list.hpp User-defined methods of the data storage class.

@Name_std.hpp User-defined methods of the data storage class.

CNcbiOstrstreamToString class helps convert CNcbiOstrstream to a string Sample usage:

static const char * str(char *buf, int n)

static string s_GetFirstNameInitials(const string &first_name)

bool RemoveFirstName(objects::CName_std &std_name)

bool ApplyMiddleInitial(objects::CName_std &std_name, const string &newValue, objects::edit::EExistingText existing_text)

static bool s_EditText(string &str, const string &find, const string &repl, ESearchLoc loc, bool case_sensitive, bool is_regex=false)

static bool s_FixInitials(objects::CName_std &name)

static string s_GetMobileElemTType(const string &value)

static string s_GetMobileElemTName(const string &value)

static string s_FixProteinNameFormat(const string &protein, const vector< string > &taxnames)

unsigned ApplyAuthorNames(objects::CAuth_list &auth_list, const string &newValue)

string TransformForCSV(const string &str)

static bool s_ReverseAuthorNames(objects::CName_std &name)

bool RemoveMiddleInitial(objects::CName_std &std_name)

static void s_BuildName(const string &firstname, const string &mid_initials, const string &lastname, const string &suffix, objects::CName_std &name)

static bool s_TruncateMiddleInitials(objects::CName_std &name)

static string s_MakeMobileElementT(const string &type, const string &name)

bool ApplyFirstName(objects::CName_std &std_name, const string &newValue, objects::edit::EExistingText existing_text)

vector< string > GetSynonymFilenames(const vector< CRef< CMacroRep >> &macro_list) const

Extracts synonym files present in the list of macros.

static bool s_MoveMiddleToFirst(objects::CName_std &name)

CMacroRep * Parse(const string &macro_text)

Parses macro script into its binary representation.

#define MSerial_AsnText

I/O stream manipulators –.

CRef< C > Ref(C *object)

Helper functions to get CRef<> and CConstRef<> objects.

void SetInitials(const TInitials &value)

Assign a value to Initials data member.

void ResetInitials(void)

Reset Initials data member.

const TInitials & GetInitials(void) const

Get the Initials member data.

void ResetFirst(void)

Reset First data member.

void SetLast(const TLast &value)

Assign a value to Last data member.

void SetFirst(const TFirst &value)

Assign a value to First data member.

bool IsSetInitials(void) const

first + middle initials Check if a value has been assigned to Initials data member.

virtual void Reset(void)

Reset the whole object.

const TFirst & GetFirst(void) const

Get the First member data.

bool IsSetFirst(void) const

Check if a value has been assigned to First data member.

Macro engine for macro execution.

static void text(MDB_val *v)

constexpr auto sort(_Init &&init)

constexpr bool empty(list< Ts... >) noexcept

@ eExistingText_append_space

@ eExistingText_append_none

@ eExistingText_leave_old

@ eExistingText_replace_old

Utility stuff for more convenient using of Boost.Test library.

string MakeAsn(const T &object)

BOOST_AUTO_TEST_CASE(Test_FixProteinNames)

void Test_SynonymFiles(const string &macro, const string &syn_file, CMacroEngine &engine)


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4