public String getOsisRef() { return getOsisID(); }
buf.append(v11n.decodeOrdinal(i++).getOsisID()); buf.append('\t'); buf.append(blockNum);
public String getOsisID() { // This range is exactly a whole book if (isWholeBook()) { // Just report the name of the book, we don't need to worry // about the base since we start at the start of a book, and // should have been recently normalized() return start.getBook().getOSIS(); } // If this range is exactly a whole chapter if (isWholeChapter()) { // Just report the name of the book and the chapter return start.getBook().getOSIS() + Verse.VERSE_OSIS_DELIM + start.getChapter(); } int startOrdinal = start.getOrdinal(); int endOrdinal = end.getOrdinal(); // to see if it is wholly contained in the range and output it if it is. // Estimate the size of the buffer: book.dd.dd (where book is 3-5, 3 typical) StringBuilder buf = new StringBuilder((endOrdinal - startOrdinal + 1) * 10); buf.append(start.getOsisID()); for (int i = startOrdinal + 1; i < endOrdinal; i++) { buf.append(AbstractPassage.REF_OSIS_DELIM); buf.append(v11n.decodeOrdinal(i).getOsisID()); } // It just might be a single verse range! if (startOrdinal != endOrdinal) { buf.append(AbstractPassage.REF_OSIS_DELIM); buf.append(end.getOsisID()); } return buf.toString(); }
/** * Convert the verse correctly to the v11n or return null */ @Nullable private Verse convertVerseStrictly(Verse verse, Versification toVersification) { try { Key key = versificationsMapper.mapVerse(verse, toVersification); Verse mappedVerse = KeyUtil.getVerse(key); // If target v11n does not contain mapped verse then an exception normally occurs and the ordinal is set to 0 if (mappedVerse.getOrdinal()>0) { return mappedVerse; } } catch (Exception e) { // unexpected problem during mapping Log.e(TAG, "JSword Versification mapper failed to map "+verse.getOsisID()+" from "+verse.getVersification().getName()+" to "+toVersification.getName(), e); } return null; } }
public static Key getWholeChapter(Verse currentVerse) { Log.i(TAG, "Get Chapter for:"+currentVerse.getOsisID()); Versification versification = currentVerse.getVersification(); BibleBook book = currentVerse.getBook(); int chapter = currentVerse.getChapter(); Verse targetChapterFirstVerse = new Verse(versification, book, chapter, 0); Verse targetChapterLastVerse = new Verse(versification, book, chapter, versification.getLastVerse(book, chapter)); // convert to full chapter before returning because bible view is for a full chapter return new VerseRange(versification, targetChapterFirstVerse, targetChapterLastVerse); }
Verse verse = (Verse) key; String raw = bible.getRawText(verse); String osisID = verse.getOsisID(); String currentBookName = verse.getBook().getOSIS(); int currentChapter = verse.getChapter();