@Override
  public Key getVersesForAugmentedStrong(final String augmentedStrong) {
    final EntityDoc[] entityDocs =
        this.augmentedStrongs.searchExactTermBySingleField("augmentedStrong", 1, augmentedStrong);
    if (entityDocs.length == 0) {
      return PassageKeyFactory.instance().createEmptyKeyList(getOTBookVersification());
    }

    // otherwise we have some
    if (entityDocs.length > 1) {
      LOGGER.warn("Too many augmented strongs in the index for strong: [{}]", augmentedStrong);
    }

    try {
      return PassageKeyFactory.instance()
          .getKey(getOTBookVersification(), entityDocs[0].get(AS_REFERENCES));
    } catch (NoSuchKeyException e) {
      throw new StepInternalException(
          "Unable to parse references for some of the entries in the augmented strongs data", e);
    }
  }
Esempio n. 2
0
 private synchronized void checkKeysGenerated() {
   if (mReadingKeys == null) {
     List<Key> readingKeyList = new ArrayList<Key>();
     if (StringUtils.isNotEmpty(mReadings)) {
       String[] readingArray = mReadings.split(",");
       for (String reading : readingArray) {
         try {
           readingKeyList.add(PassageKeyFactory.instance().getKey(reading));
         } catch (NoSuchKeyException nsk) {
           Log.e(TAG, "Error getting daily reading passage", nsk);
         }
       }
     }
     mReadingKeys = readingKeyList;
   }
 }