use of org.springframework.core.io.ClassRelativeResourceLoader in project webapp by elimu-ai.
the class EPubImageExtractionHelperTest method testExtractImageReferenceFromChapterFile_BEN_GDL_761.
@Test
public void testExtractImageReferenceFromChapterFile_BEN_GDL_761() throws IOException {
ResourceLoader resourceLoader = new ClassRelativeResourceLoader(EPubImageExtractionHelper.class);
Resource resource = resourceLoader.getResource("ben-gdl-761.epub_chapter-2.xhtml");
File xhtmlFile = resource.getFile();
logger.debug("xhtmlFile: " + xhtmlFile);
String imageReference = EPubImageExtractionHelper.extractImageReferenceFromChapterFile(xhtmlFile);
assertThat(imageReference, is("1e8e58cc7d627a7896737cfb3eba8270.jpg"));
}
use of org.springframework.core.io.ClassRelativeResourceLoader in project webapp by elimu-ai.
the class EPubParagraphExtractionHelperTest method testExtractParagraphsFromChapterFile_SWA_GDL_30.
@Test
public void testExtractParagraphsFromChapterFile_SWA_GDL_30() throws IOException {
ResourceLoader resourceLoader = new ClassRelativeResourceLoader(EPubParagraphExtractionHelper.class);
Resource resource = resourceLoader.getResource("swa-gdl-30.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("Kuku na Jongoo walikuwa marafiki."));
}
use of org.springframework.core.io.ClassRelativeResourceLoader in project webapp by elimu-ai.
the class EPubParagraphExtractionHelperTest method testExtractParagraphsFromChapterFile_FIL_LRA_7f877260_ch4.
@Test
public void testExtractParagraphsFromChapterFile_FIL_LRA_7f877260_ch4() throws IOException {
ResourceLoader resourceLoader = new ClassRelativeResourceLoader(EPubParagraphExtractionHelper.class);
Resource resource = resourceLoader.getResource("fil-lra-7f877260-ec7c-4970-b6e2-2ee41231d96d.epub_Page_4.xhtml");
File xhtmlFile = resource.getFile();
logger.debug("xhtmlFile: " + xhtmlFile);
List<String> storyBookParagraphs = EPubParagraphExtractionHelper.extractParagraphsFromChapterFile(xhtmlFile);
assertThat(storyBookParagraphs.size(), is(2));
assertThat(storyBookParagraphs.get(0), is("Ano kaya kung kaya kang palundagin ng jelly beans nang napakataas?"));
assertThat(storyBookParagraphs.get(1), is("Maari kang makarating sa paaralan sa isang malaking hakbang."));
}
use of org.springframework.core.io.ClassRelativeResourceLoader in project webapp by elimu-ai.
the class EPubParagraphExtractionHelperTest method testExtractParagraphsFromChapterFile_HIN_SW_99651_ch3.
@Test
public void testExtractParagraphsFromChapterFile_HIN_SW_99651_ch3() throws IOException {
ResourceLoader resourceLoader = new ClassRelativeResourceLoader(EPubParagraphExtractionHelper.class);
Resource resource = resourceLoader.getResource("hin-sw-99651-hamare-mitra-kon-hai.epub_3.xhtml");
File xhtmlFile = resource.getFile();
logger.debug("xhtmlFile: " + xhtmlFile);
List<String> storyBookParagraphs = EPubParagraphExtractionHelper.extractParagraphsFromChapterFile(xhtmlFile);
assertThat(storyBookParagraphs.size(), is(2));
assertThat(storyBookParagraphs.get(0), is("हमारा सबसे अच्छा मित्र है पक्षी!"));
assertThat(storyBookParagraphs.get(1), is("(चिड़िया)"));
}
use of org.springframework.core.io.ClassRelativeResourceLoader in project webapp by elimu-ai.
the class EPubParagraphExtractionHelperTest method testExtractParagraphsFromChapterFile_HIN_GDL_1296.
@Test
public void testExtractParagraphsFromChapterFile_HIN_GDL_1296() throws IOException {
ResourceLoader resourceLoader = new ClassRelativeResourceLoader(EPubParagraphExtractionHelper.class);
Resource resource = resourceLoader.getResource("hin-gdl-1296.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