phase 0: fork Episteme, rename package to org.dueattendant149.bookreader
- Cloned from Aryan-Raj3112/episteme (AGPL-3.0) - Package: com.aryan.reader → org.dueattendant149.bookreader - Application ID: org.dueattendant149.bookreader - Added AGENTS.md with migration plan - Upstream: github.com/Aryan-Raj3112/episteme - Origin: git.dueattendant149.org/Atte149/book-reader
This commit is contained in:
parent
e615128a23
commit
5f64f3d722
631 changed files with 3082 additions and 3006 deletions
|
|
@ -1,46 +0,0 @@
|
|||
package com.aryan.reader
|
||||
|
||||
import com.aryan.reader.paginatedreader.TtsChunk
|
||||
import com.aryan.reader.shared.ReaderTtsReplacementPreferences
|
||||
import com.aryan.reader.shared.ReaderTtsReplacementRule
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Test
|
||||
|
||||
class TtsReplacementChunkTest {
|
||||
@Test
|
||||
fun `tts chunk spoken text falls back to original text`() {
|
||||
val chunk = TtsChunk(
|
||||
text = "Dr. Smith",
|
||||
sourceCfi = "epubcfi(/6/2)",
|
||||
startOffsetInSource = 12
|
||||
)
|
||||
|
||||
assertEquals("Dr. Smith", chunk.spokenText)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `chunk preparation keeps original text and writes spoken text`() {
|
||||
val preferences = ReaderTtsReplacementPreferences(
|
||||
globalRules = listOf(
|
||||
ReaderTtsReplacementRule(
|
||||
id = "dr",
|
||||
from = "Dr.",
|
||||
to = "Doctor",
|
||||
wholeWord = false
|
||||
)
|
||||
)
|
||||
)
|
||||
val chunk = TtsChunk(
|
||||
text = "Dr. Smith",
|
||||
sourceCfi = "epubcfi(/6/2)",
|
||||
startOffsetInSource = 12
|
||||
)
|
||||
|
||||
val prepared = listOf(chunk).withTtsReplacements(preferences, "book").single()
|
||||
|
||||
assertEquals("Dr. Smith", prepared.text)
|
||||
assertEquals("Doctor Smith", prepared.spokenText)
|
||||
assertEquals("epubcfi(/6/2)", prepared.sourceCfi)
|
||||
assertEquals(12, prepared.startOffsetInSource)
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue