use of org.crosswire.jsword.passage.RangedPassage in project step by STEPBible.
the class SubjectEntryServiceImpl method getCombinedBookScope.
/**
* Gets a key in the KJV versification that represents the total combined key for all search resutls.
*
* @param inputVersions the input version the kjv versified keys
* @return
*/
private Passage getCombinedBookScope(String[] inputVersions) {
final Versification bestVersification = this.versificationService.getVersificationForVersion(JSwordPassageService.BEST_VERSIFICATION);
Passage range = new RangedPassage(bestVersification);
for (final String v : inputVersions) {
final Book bookFromVersion = this.versificationService.getBookFromVersion(v);
final VerseKey scope = bookFromVersion.getBookMetaData().getScope();
range.addAll(VersificationsMapper.instance().map(KeyUtil.getPassage(scope), bestVersification));
}
return range;
}
use of org.crosswire.jsword.passage.RangedPassage in project step by STEPBible.
the class SubjectSearchServiceImpl method getScopeForVersions.
/**
* Iterates through the versions, obtaining the maximum allowed scope for this query
*
* @param originalVersions the original versions prior to the query being run.
* @return the scope for all versions combined
*/
private Passage getScopeForVersions(String[] originalVersions) {
final Versification v11n = this.jSwordVersificationService.getVersificationForVersion(JSwordPassageService.BEST_VERSIFICATION);
Passage total = new RangedPassage(v11n);
for (String version : originalVersions) {
Passage scope = KeyUtil.getPassage(this.jSwordVersificationService.getBookFromVersion(version).getBookMetaData().getScope());
total.addAll(VersificationsMapper.instance().map(scope, v11n));
}
return total;
}
Aggregations