Fix ReadabilityTest
This commit is contained in:
parent
278d78532b
commit
f03a91c1d3
2 changed files with 1 additions and 4 deletions
|
@ -2,7 +2,7 @@ package com.wbrawner.simplemarkdown.model
|
|||
|
||||
import eu.crydee.syllablecounter.SyllableCounter
|
||||
|
||||
class Sentence(content: String, private var start: Int = 0, private val end: Int = 0) {
|
||||
class Sentence(content: String, private var start: Int = 0, private val end: Int = content.length) {
|
||||
|
||||
private var sentence = content.substring(start, end)
|
||||
private val sc = SyllableCounter()
|
||||
|
|
|
@ -38,12 +38,9 @@ class ReadabilityTest {
|
|||
assertEquals(39, thisIsATest.end().toLong())
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
fun get_syllable_count_for_sentence() {
|
||||
assertEquals(8, Sentence("This is the song that never ends").syllableCount().toLong())
|
||||
assertEquals(10, Sentence("facility facility downing").syllableCount().toLong())
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue