Search in sources :

Example 1 with VocabInfo

use of com.tyndalehouse.step.models.info.VocabInfo in project step by STEPBible.

the class ModuleController method translateToVocabInfo.

/**
 * Copies over information.
 *
 * @param vocabResponse  the vocab response, including the definitions and the mappings to their related words
 * @param includeAllInfo true to include all information
 * @return a list of infos
 */
private List<VocabInfo> translateToVocabInfo(final VocabResponse vocabResponse, final boolean includeAllInfo, final String userLanguage) {
    final List<VocabInfo> morphologyInfos = new ArrayList<VocabInfo>(vocabResponse.getDefinitions().length);
    EntityDoc[] definitions = vocabResponse.getDefinitions();
    for (int i = 0; i < definitions.length; i++) {
        EntityDoc d = definitions[i];
        morphologyInfos.add(new VocabInfo(d, vocabResponse.getRelatedWords(), includeAllInfo, userLanguage));
    }
    return morphologyInfos;
}
Also used : ArrayList(java.util.ArrayList) EntityDoc(com.tyndalehouse.step.core.data.EntityDoc) VocabInfo(com.tyndalehouse.step.models.info.VocabInfo)

Aggregations

EntityDoc (com.tyndalehouse.step.core.data.EntityDoc)1 VocabInfo (com.tyndalehouse.step.models.info.VocabInfo)1 ArrayList (java.util.ArrayList)1