use of org.springframework.core.io.ResourceLoader in project webapp by elimu-ai.
the class EPubParagraphExtractionHelperTest method testExtractParagraphsFromChapterFile_FIL_LRA_faa0d66e.
@Test
public void testExtractParagraphsFromChapterFile_FIL_LRA_faa0d66e() throws IOException {
ResourceLoader resourceLoader = new ClassRelativeResourceLoader(EPubParagraphExtractionHelper.class);
Resource resource = resourceLoader.getResource("fil-lra-faa0d66e-564f-4d72-a1d3-ec46fb754205.epub_Page_3.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("WAAAAHHHH!"));
assertThat(storyBookParagraphs.get(1), is("Ang ibong Brahminy ay umiiyak tulad ng isang gutom na sanggol."));
assertThat(storyBookParagraphs.get(2), is("WAAAAHHHH!"));
}
use of org.springframework.core.io.ResourceLoader in project webapp by elimu-ai.
the class EPubParagraphExtractionHelperTest method testExtractParagraphsFromChapterFile_HIN_GDL_1296_ch3.
@Test
public void testExtractParagraphsFromChapterFile_HIN_GDL_1296_ch3() throws IOException {
ResourceLoader resourceLoader = new ClassRelativeResourceLoader(EPubParagraphExtractionHelper.class);
Resource resource = resourceLoader.getResource("hin-gdl-1296.epub_chapter-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_BEN_SW_11791.
@Test
public void testExtractParagraphsFromChapterFile_BEN_SW_11791() throws IOException {
ResourceLoader resourceLoader = new ClassRelativeResourceLoader(EPubParagraphExtractionHelper.class);
Resource resource = resourceLoader.getResource("ben-sw-11791-ghumkature-bhim.epub_2.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_ENG_GDL_1349.
@Test
public void testExtractParagraphsFromChapterFile_ENG_GDL_1349() throws IOException {
ResourceLoader resourceLoader = new ClassRelativeResourceLoader(EPubParagraphExtractionHelper.class);
Resource resource = resourceLoader.getResource("eng-gdl-1349.epub_chapter-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("Fifth grade student, Little Miss Grace,"));
assertThat(storyBookParagraphs.get(1), is("was totally fascinated by outer space."));
}
use of org.springframework.core.io.ResourceLoader in project webapp by elimu-ai.
the class AudioMetadataExtractionHelperTest method testGetDurationInMillisecondsOGG.
@Test
public void testGetDurationInMillisecondsOGG() throws IOException {
ResourceLoader resourceLoader = new ClassRelativeResourceLoader(AudioMetadataExtractionHelper.class);
Resource resource = resourceLoader.getResource("example.ogg");
File audioFile = resource.getFile();
logger.debug("audioFile: " + audioFile);
Long durationMs = AudioMetadataExtractionHelper.getDurationInMilliseconds(audioFile);
assertThat(durationMs, not(nullValue()));
// 6s
assertThat(durationMs, is(6000L));
}
Aggregations