public Key getKey(String name) throws NoSuchKeyException { return book.getKey(name); }
public void setKey(String keyText) { Log.d(TAG, "key text:"+keyText); try { Key key = getCurrentDocument().getKey(keyText); setKey(key); } catch (NoSuchKeyException nske) { Log.e(TAG, "Invalid verse reference:"+keyText); } }
/** user has selected a Strong's Number link so show Strong's page for key in link */ private void showStrongs(Book book, String key) throws NoSuchKeyException { // valid Strongs uri but Strongs refs not installed if (book==null) { Dialogs.getInstance().showErrorMsg(R.string.strongs_not_installed); // this uri request was handled by showing an error message return; } Key strongsNumberKey = book.getKey(key); showLink(book, strongsNumberKey); }
/** user has selected a morphology link so show morphology page for key in link */ private void showRobinsonMorphology(String key) throws NoSuchKeyException { Book robinson = swordDocumentFacade.getDocumentByInitials("robinson"); // valid Strongs uri but Strongs refs not installed if (robinson==null) { Dialogs.getInstance().showErrorMsg(R.string.morph_robinson_not_installed); // this uri request was handled by showing an error message return; } Key robinsonNumberKey = robinson.getKey(key); showLink(robinson, robinsonNumberKey); }
public void updateOsisStack(Book book, Key key, LinkedList<Content> stack) { Element ele = OSIS_FACTORY.createReference(); String refstr = getName().substring(2); try { Passage ref = (Passage) book.getKey(refstr); ele.setAttribute(OSISUtil.OSIS_ATTR_REF, ref.getOsisRef()); } catch (NoSuchKeyException ex) { DataPolice.report(book, key, "unable to parse reference: " + refstr); } GBFTags.updateOsisStack(stack, ele); } }
@Test public void testReadTitle() throws Exception { Book book = getBook("ESV2011"); OSISInputStream osisInputStream = new OSISInputStream(book, book.getKey("Hosea 1:2")); String verse = convertStreamToString(osisInputStream); System.out.println(verse); osisInputStream = new OSISInputStream(book, book.getKey("Ps 25:1")); verse = convertStreamToString(osisInputStream); System.out.println(verse); }
public void testReadWordsOfChrist() throws Exception { Book esv = getBook("ESV2011"); OSISInputStream osisInputStream = new OSISInputStream(esv, esv.getKey("Luke 14:3")); String chapter = convertStreamToString(osisInputStream); // int numOpeningDivs = count(chapter, "<div>"); // int numClosingDivs = count(chapter, "</div>"); System.out.println(chapter); // assertEquals("wrong number of divs", numOpeningDivs, numClosingDivs); }
public void testReadABPGRKJn1() throws Exception { Book kjv = getBook("ABP"); OSISInputStream osisInputStream = new OSISInputStream(kjv, kjv.getKey("Jn 1:1")); String chapter = convertStreamToString(osisInputStream); // int numOpeningDivs = count(chapter, "<div>"); // int numClosingDivs = count(chapter, "</div>"); System.out.println(chapter); }
public void testReadMergedVerse() throws Exception { Book esv = getBook("TurNTB"); OSISInputStream osisInputStream = new OSISInputStream(esv, esv.getKey("Eph 2:4,5")); String chapter = convertStreamToString(osisInputStream); System.out.println(chapter); } /**
@Test public void testReadTSK() throws Exception { Book book = getBook("TSK"); if (book != null) { OSISInputStream osisInputStream = new OSISInputStream(book, book.getKey("Ps 118:2")); String chapter = convertStreamToString(osisInputStream); System.out.println(chapter); } }
/** * Test method for {@link net.bible.service.format.OSISInputStream#read()}. */ public void testReadNetBible() throws Exception { OSISInputStream osisInputStream = new OSISInputStream(netBook, netBook.getKey("Gen 4")); String chapter = convertStreamToString(osisInputStream); int numOpeningDivs = count(chapter, "<div>"); int numClosingDivs = count(chapter, "</div>"); System.out.println(chapter); assertThat("wrong number of divs", numOpeningDivs, equalTo(numClosingDivs)); }
@Test public void testRead() throws Exception { Book book = getBook("ISV"); OSISInputStream osisInputStream = new OSISInputStream(book, book.getKey("Mat 5:1-5:3")); String chapter = convertStreamToString(osisInputStream); System.out.println(chapter); }
/** * Test method for {@link net.bible.service.format.OSISInputStream#read()}. */ public void testReadSingleChapterBook() throws Exception { OSISInputStream osisInputStream = new OSISInputStream(netBook, netBook.getKey("3 John")); String chapter = convertStreamToString(osisInputStream); int numOpeningDivs = count(chapter, "<div>"); int numClosingDivs = count(chapter, "</div>"); System.out.println(chapter); assertThat("wrong number of divs", numOpeningDivs, equalTo(numClosingDivs)); }
public void testRead1Peter1v10() throws Exception { Book book = getBook("WEB"); OSISInputStream osisInputStream = new OSISInputStream(book, book.getKey("1 Peter 1")); String chapter = convertStreamToString(osisInputStream); int numOpeningDivs = count(chapter, "<div>"); int numClosingDivs = count(chapter, "</div>"); System.out.println(chapter); assertThat("wrong number of divs", numOpeningDivs, equalTo(numClosingDivs)); System.out.println(chapter); }
public void testReadDarbyBible() throws Exception { Book book = getBook("Darby"); OSISInputStream osisInputStream = new OSISInputStream(book, book.getKey("Gen 1")); String chapter = convertStreamToString(osisInputStream); int numOpeningDivs = count(chapter, "<div>"); int numClosingDivs = count(chapter, "</div>"); System.out.println(chapter); assertThat("wrong number of divs", numOpeningDivs, equalTo(numClosingDivs)); }
/** * Test method for {@link net.bible.service.format.OSISInputStream#read()}. */ public void testReadVeryLongBook() throws Exception { Book esv = getBook("ESV2011"); OSISInputStream osisInputStream = new OSISInputStream(esv, esv.getKey("Ps 119")); String chapter = convertStreamToString(osisInputStream); int numOpeningDivs = count(chapter, "<div>"); int numClosingDivs = count(chapter, "</div>"); System.out.println(chapter); assertThat("wrong number of divs", numOpeningDivs, equalTo(numClosingDivs)); }
@Test public void testReadRuCarsPoetry() throws Exception { Book book = getBook("RusCARS"); if (book!=null) { OSISInputStream osisInputStream = new OSISInputStream(book, book.getKey("Ps 116")); String chapter = convertStreamToString(osisInputStream); int numOpeningDivs = count(chapter, "<div>"); int numClosingDivs = count(chapter, "</div>"); assertThat("wrong number of divs", numOpeningDivs, equalTo(numClosingDivs)); System.out.println(chapter); } }
@Test public void testReadESVAndBibleMethod() throws Exception { Book book = getBook("ESV2011"); OSISInputStream osisInputStream = new OSISInputStream(book, book.getKey("Phil 1:3")); String chapter = convertStreamToString(osisInputStream); int numOpeningDivs = count(chapter, "<div>"); int numClosingDivs = count(chapter, "</div>"); System.out.println("START"+chapter+"END"); assertThat("wrong number of divs", numOpeningDivs, equalTo(numClosingDivs)); }
@Test public void testReadHunUjReference() throws Exception { //JFB and many other commentaries are THML. Abbott is OSIS Book book = getBook("HunUj"); if (book!=null) { OSISInputStream osisInputStream = new OSISInputStream(book, book.getKey("Jam 1:1")); String chapter = convertStreamToString(osisInputStream); int numOpeningDivs = count(chapter, "<div>"); int numClosingDivs = count(chapter, "</div>"); assertThat("wrong number of divs", numOpeningDivs, equalTo(numClosingDivs)); System.out.println(chapter); } }
public void testReadLastChapter() throws Exception { for (Book book: books) { if (book.getBookCategory().equals(BookCategory.BIBLE)) { System.out.println("Book:"+book.getInitials()); OSISInputStream osisInputStream = new OSISInputStream(book, book.getKey("3 John")); String chapter = convertStreamToString(osisInputStream); int numOpeningDivs = count(chapter, "<div>"); int numClosingDivs = count(chapter, "</div>"); // System.out.println(chapter); assertThat("wrong number of divs in "+book, numOpeningDivs, equalTo(numClosingDivs)); } } }