void Checks_Versification::verses (string bible, int book, int chapter, vector <int> verses) { // Get verses in this chapter according to the versification system for the Bible. Database_Versifications database_versifications; string versification = Database_Config_Bible::getVersificationSystem (bible); if (versification.empty ()) versification = english (); vector <int> standardVerses = database_versifications.getVerses (versification, book, chapter); // Look for missing and extra verses. vector <int> absentVerses = filter_string_array_diff (standardVerses, verses); vector <int> extraVerses = filter_string_array_diff (verses, standardVerses); Database_Check database_check; for (auto verse : absentVerses) { database_check.recordOutput (bible, book, chapter, verse, "This verse is missing according to the versification system"); } for (auto verse : extraVerses) { //if ((chapter == 0) && (verse == 0)) continue; database_check.recordOutput (bible, book, chapter, verse, "This verse is extra according to the versification system"); } // Look for verses out of order. int previousVerse = 0; for (unsigned int i = 0; i < verses.size(); i++) { int verse = verses[i]; if (i > 0) { if (verse != (previousVerse + 1)) { database_check.recordOutput (bible, book, chapter, verse, "The verse is out of sequence"); } } previousVerse = verse; } }
// Get Strong's numbers and English snippets for book / chapter / verse. vector <Database_Kjv_Item> Database_Kjv::getVerse (int book, int chapter, int verse) { vector <Database_Kjv_Item> hits; vector <int> rows = rowids (book, chapter, verse); for (auto row : rows) { Database_Kjv_Item item; item.strong = strong (row); item.english = english (row); hits.push_back (item); } return hits; }
int main(int argc, char *argv[]) { retain<Language> as(&NO_LANGUAGE); // *** for (int argi=1; argi<argc; ++argi) { if (strcmp(argv[argi],"english")==0) { english(); continue; } if (strcmp(argv[argi],"spanish")==0) { spanish(); continue; } if (strcmp(argv[argi],"greet")==0) { greet(); continue; } if (strcmp(argv[argi],"hello")==0) { hello(); continue; } if (strcmp(argv[argi],"hola")==0) { hola(); continue; } std::cout << "unkown arg[" << argi << "]='" << argv[argi] << "'" << std::endl; } return 0; }
void Checks_Versification::chapters (string bible, int book, vector <int> chapters) { Database_Versifications database_versifications; string versification = Database_Config_Bible::getVersificationSystem (bible); if (versification.empty ()) versification = english (); vector <int> standardChapters = database_versifications.getChapters (versification, book, true); vector <int> absentChapters = filter_string_array_diff (standardChapters, chapters); vector <int> extraChapters = filter_string_array_diff (chapters, standardChapters); Database_Check database_check; for (auto chapter : absentChapters) { database_check.recordOutput (bible, book, chapter, 1, "This chapter is missing"); } for (auto chapter : extraChapters) { database_check.recordOutput (bible, book, chapter, 1, "This chapter is extra"); } }
void Checks_Versification::books (string bible, vector <int> books) { Database_Versifications database_versifications; string versification = Database_Config_Bible::getVersificationSystem (bible); if (versification.empty ()) versification = english (); vector <int> standardBooks = database_versifications.getBooks (versification); vector <int> absentBooks = filter_string_array_diff (standardBooks, books); vector <int> extraBooks = filter_string_array_diff (books, standardBooks); Database_Check database_check; for (auto book : absentBooks) { database_check.recordOutput (bible, book, 1, 1, "This book is absent from the Bible"); } for (auto book : extraBooks) { database_check.recordOutput (bible, book, 1, 1, "This book is extra in the Bible"); } }
int testTrDlg::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QDialog::qt_metacall(_c, _id, _a); if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { switch (_id) { case 0: english(); break; case 1: chinese(); break; case 2: ILoveMyFamily(); break; case 3: testTr(); break; } _id -= 4; } return _id; }
string Navigation_Passage::getVersesFragment (void * webserver_request, string bible, int book, int chapter, int verse) { Webserver_Request * request = (Webserver_Request *) webserver_request; vector <int> verses; if (bible == "") { Database_Versifications database_versifications; verses = database_versifications.getVerses (english (), book, chapter); } else { verses = usfm_get_verse_numbers (request->database_bibles()->getChapter (bible, book, chapter)); } string html; html.append (" "); for (auto vs : verses) { bool selected = (verse == vs); addSelectorLink (html, convert_to_string (vs), "applyverse", convert_to_string (vs), selected); } addSelectorLink (html, "cancel", "applyverse", "[" + translate ("cancel") + "]", false); html.insert (0, "<span id=\"applyverse\">" + translate ("Select verse")); html.append ("</span>"); return html; }
string Navigation_Passage::getChaptersFragment (void * webserver_request, string bible, int book, int chapter) { Webserver_Request * request = (Webserver_Request *) webserver_request; vector <int> chapters; if (bible.empty ()) { Database_Versifications database_versifications; chapters = database_versifications.getChapters (english (), book, true); } else { chapters = request->database_bibles()->getChapters (bible, book); } string html; html.append (" "); for (auto ch : chapters) { bool selected = (ch == chapter); addSelectorLink (html, convert_to_string (ch), "applychapter", convert_to_string (ch), selected); } addSelectorLink (html, "cancel", "applychapter", "[" + translate ("cancel") + "]", false); html.insert (0, "<span id=\"applychapter\">" + translate ("Select chapter")); html.append ("</span>"); return html; }
/* Routine to take 1 turn */ void turn() { int i, hint; static int waste = 0; if (newtravel) { /* If closing, then he can't leave except via the main office. */ if (outside(g.newloc) && g.newloc != 0 && g.closing) { rspeak(130); g.newloc = g.loc; if (!g.panic) g.clock2 = 15; g.panic = TRUE; } /* See if a dwarf has seen him and has come from where he wants to go. */ if (g.newloc != g.loc && !forced(g.loc) && g.loc_attrib[g.loc] & NOPIRAT == 0) for (i = 1; i < (DWARFMAX - 1); ++i) if (g.odloc[i] == g.newloc && g.dseen[i]) { g.newloc = g.loc; rspeak(2); break; } g.loc = g.newloc; dwarves(); /* & special dwarf(pirate who steals) */ /* Check for death */ if (g.loc == 0) { death(); return; } /* Check for forced move */ if (forced(g.loc)) { desclg(g.loc); ++g.visited[g.loc]; domove(); return; } /* Check for wandering in dark */ if (g.wzdark && dark() && pct(35)) { rspeak(23); g.oldloc2 = g.loc; death(); return; } /* see if he is wasting his batteies out in the open */ if (outside(g.loc) && g.prop[LAMP]) { waste++; if (waste > 11) { rspeak(324); waste = 0; } } else waste = 0; /* If wumpus is chasing stooge, see if wumpus gets him */ if (g.chase) { g.chase++; g.prop[WUMPUS] = g.chase / 2; move(WUMPUS, g.loc); if (g.chase >= 10) { if (dark()) rspeak(270); pspeak(WUMPUS, 5); death(); return; } } /* check for radiation poisoning. */ g.health += (outside(g.loc)) ? 3 : 1; if (g.health > 100) g.health = 100; if (here(RADIUM) && (g.place[RADIUM] != -SHIELD || ajar(SHIELD))) g.health -= 7; if (g.health < 60) { rspeak(391 + (60 - g.health) / 10); if (g.health < 0) { death(); return; } } if ((g.oldloc == 188) && (g.loc != 188 && g.loc != 189) && (g.prop[BOOTH] == 1)) { move(GNOME, 0); g.prop[BOOTH] = 0; } /* Describe his situation */ describe(); if (!blind()) { ++g.visited[g.loc]; descitem(); } } /* end of newtravel start for second entry point */ /* Check if this location is eligible for any hints. If been here long enough, branch to help section. Ignore "hints" < HNTMIN (special stuff, see database notes. */ for (hint = HNTMIN; hint <= HNTMAX; hint++) { if (g.hinted[hint]) continue; if (g.loc_attrib[g.loc] / 256 != hint - 6) g.hintlc[hint] = -1; g.hintlc[hint]++; if (g.hintlc[hint] >= g.hints[hint][1]) do_hint(hint); } if (g.closed) { if (g.prop[OYSTER] < 0 && toting(OYSTER)) pspeak(OYSTER, 1); for (i = 1; i < MAXOBJ; ++i) if (toting(i) && g.prop[i] < 0) g.prop[i] = -1 - g.prop[i]; } g.wzdark = dark(); if (g.knfloc > 0 && g.knfloc != g.loc) g.knfloc = 0; ++g.turns; i = rand(); if (stimer()) /* as the grains of sand slip by */ return; while (!english()) /* retrieve player instructions */ ; vrbx = 1; objx = objs[1] ? 1 : 0; iobx = iobjs[1] ? 1 : 0; verb = VAL(verbs[vrbx]); do { object = objx ? objs[objx] : 0; iobj = iobx ? iobjs[iobx] : 0; if (object && (objs[2] || iobjs[2])) { pspeak(object, -1); printf(" "); } switch (CLASS(verbs[vrbx])) { case MOTION: motion = verb; domove(); break; case NOUN: bug(22); case ACTION: if (object || iobj) trverb(); else itverb(); break; case MISC: rspeak(verb); if (verb == 51) g.hinted[1] = TRUE; break; default: bug(22); } if (objx) { objx++; if (objs[objx] == 0) objx = 0; } if ((!objx || !objs[objx]) && iobx) { iobx++; if (iobjs[iobx] == 0) iobx = 0; if (iobx && iobjs[1]) objx = 1; } } while (objx || iobx); return; }
string Database_Config_Bible::getVerseMapping (string bible) { return getValue (bible, "verse-mapping", english ()); }
string Database_Config_Bible::getVersificationSystem (string bible) { return getValue (bible, "versification-system", english ()); }
String intToEnglish(int32_t i) { String english(_intToEnglish(i)); boost::trim(english); return english; }