use of org.springframework.core.io.ResourceLoader 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.ResourceLoader 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.ResourceLoader 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("एक बादल घुमने चला."));
}
use of org.springframework.core.io.ResourceLoader in project webapp by elimu-ai.
the class EPubParagraphExtractionHelperTest method testExtractParagraphsFromChapterFile_HIN_SW_141016_ch8.
@Test
public void testExtractParagraphsFromChapterFile_HIN_SW_141016_ch8() throws IOException {
ResourceLoader resourceLoader = new ClassRelativeResourceLoader(EPubParagraphExtractionHelper.class);
Resource resource = resourceLoader.getResource("hin-sw-141016-tumi-ke-park-ka-din.epub_8.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("\"देखो माँ, मैं बंदर की तरह झूल रही हूँ।\""));
}
use of org.springframework.core.io.ResourceLoader in project webapp by elimu-ai.
the class EPubParagraphExtractionHelperTest method testExtractParagraphsFromChapterFile_HIN_GDL_1287_ch3.
// TODO: handle   interpreted as white space: "कुत्ता  सैर"
@Ignore
@Test
public void testExtractParagraphsFromChapterFile_HIN_GDL_1287_ch3() throws IOException {
ResourceLoader resourceLoader = new ClassRelativeResourceLoader(EPubParagraphExtractionHelper.class);
Resource resource = resourceLoader.getResource("hin-gdl-1287.epub_chapter-3.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