use of org.springframework.core.io.ResourceLoader in project webapp by elimu-ai.
the class EPubMetadataExtractionHelperTest method testExtractTitleFromOpfFile_BEN_GLOBAL_DIGITAL_LIBRARY.
@Test
public void testExtractTitleFromOpfFile_BEN_GLOBAL_DIGITAL_LIBRARY() throws IOException {
ResourceLoader resourceLoader = new ClassRelativeResourceLoader(EPubMetadataExtractionHelper.class);
Resource resource = resourceLoader.getResource("ben-gdl-761.epub_book.opf");
File opfFile = resource.getFile();
logger.debug("opfFile: " + opfFile);
String title = EPubMetadataExtractionHelper.extractTitleFromOpfFile(opfFile);
assertThat(title, is("উৎসব"));
String description = EPubMetadataExtractionHelper.extractDescriptionFromOpfFile(opfFile);
assertThat(description, is("পোশাক উৎসবের বর্ণ, শব্দ, গন্ধ ও অনুভূতি উপভোগ করো।"));
}
use of org.springframework.core.io.ResourceLoader in project webapp by elimu-ai.
the class EPubImageExtractionHelperTest method testExtractImageReferenceFromChapterFile_FIL_LRA_faa0d66e.
@Test
public void testExtractImageReferenceFromChapterFile_FIL_LRA_faa0d66e() throws IOException {
ResourceLoader resourceLoader = new ClassRelativeResourceLoader(EPubImageExtractionHelper.class);
Resource resource = resourceLoader.getResource("fil-lra-faa0d66e-564f-4d72-a1d3-ec46fb754205.epub_Page_3.xhtml");
File xhtmlFile = resource.getFile();
logger.debug("xhtmlFile: " + xhtmlFile);
String imageReference = EPubImageExtractionHelper.extractImageReferenceFromChapterFile(xhtmlFile);
assertThat(imageReference, is("image_3.jpg"));
}
use of org.springframework.core.io.ResourceLoader in project webapp by elimu-ai.
the class EPubImageExtractionHelperTest method testExtractImageReferenceFromChapterFile_BEN_SW_11791.
@Test
public void testExtractImageReferenceFromChapterFile_BEN_SW_11791() throws IOException {
ResourceLoader resourceLoader = new ClassRelativeResourceLoader(EPubImageExtractionHelper.class);
Resource resource = resourceLoader.getResource("ben-sw-11791-ghumkature-bhim.epub_2.xhtml");
File xhtmlFile = resource.getFile();
logger.debug("xhtmlFile: " + xhtmlFile);
String imageReference = EPubImageExtractionHelper.extractImageReferenceFromChapterFile(xhtmlFile);
assertThat(imageReference, is("image_2.jpg"));
}
use of org.springframework.core.io.ResourceLoader in project webapp by elimu-ai.
the class EPubParagraphExtractionHelperTest method testExtractParagraphsFromChapterFile_HIN_SW_10145_ch4.
@Test
public void testExtractParagraphsFromChapterFile_HIN_SW_10145_ch4() throws IOException {
ResourceLoader resourceLoader = new ClassRelativeResourceLoader(EPubParagraphExtractionHelper.class);
Resource resource = resourceLoader.getResource("hin-sw-10145-ek-sau-saintisvan-paer.epub_4.xhtml");
File xhtmlFile = resource.getFile();
logger.debug("xhtmlFile: " + xhtmlFile);
List<String> storyBookParagraphs = EPubParagraphExtractionHelper.extractParagraphsFromChapterFile(xhtmlFile);
assertThat(storyBookParagraphs.size(), is(3));
assertThat(storyBookParagraphs.get(0), is("एक गोजर एक बड़े से भूरे पत्ते के भीतर"));
assertThat(storyBookParagraphs.get(1), is("ख़ुमारी में दुबकी हुई थी।"));
assertThat(storyBookParagraphs.get(2), is("चिड़ियों की चहचहाट ने उसे जगा दिया।"));
}
use of org.springframework.core.io.ResourceLoader in project webapp by elimu-ai.
the class EPubParagraphExtractionHelperTest method testExtractParagraphsFromChapterFile_BEN_GDL_761.
@Test
public void testExtractParagraphsFromChapterFile_BEN_GDL_761() throws IOException {
ResourceLoader resourceLoader = new ClassRelativeResourceLoader(EPubParagraphExtractionHelper.class);
Resource resource = resourceLoader.getResource("ben-gdl-761.epub_chapter-2.xhtml");
File xhtmlFile = resource.getFile();
logger.debug("xhtmlFile: " + xhtmlFile);
List<String> storyBookParagraphs = EPubParagraphExtractionHelper.extractParagraphsFromChapterFile(xhtmlFile);
assertThat(storyBookParagraphs.size(), is(1));
assertThat(storyBookParagraphs.get(0), is("আজকে ছুটির দিন আনন্দে হারাই! চলো সবে পোশাকের উৎসবে যাই!"));
}
Aggregations