Bump chinese-transliteration version
All checks were successful
Pull Request / build (pull_request) Successful in 2m14s

This commit is contained in:
Marvin Elsen 2024-10-07 21:00:13 +02:00
parent a176c34361
commit de84df6940
Signed by: marvinelsen
GPG Key ID: 820672408CC318C2
5 changed files with 11 additions and 11 deletions

View File

@ -5,7 +5,7 @@ plugins {
}
group = "com.marvinelsen"
version = "2.0.0"
version = "3.0.0"
repositories {
mavenCentral()

View File

@ -2,7 +2,7 @@
kotlin = "2.0.20"
kotest = "5.9.1"
detekt = "1.23.7"
chinese-transliteration = "1.0.1"
chinese-transliteration = "2.0.0"
[libraries]
chinese-transliteration = { module = "com.marvinelsen:chinese-transliteration", version.ref = "chinese-transliteration" }

View File

@ -1,10 +1,10 @@
package com.marvinelsen.cedict.api
import com.marvinelsen.chinese.transliteration.Syllable
import com.marvinelsen.chinese.transliteration.api.PinyinSyllable
data class CedictEntry(
val traditional: String,
val simplified: String,
val pinyinSyllables: List<Syllable>,
val pinyinSyllables: List<PinyinSyllable>,
val definitions: List<CedictDefinition>,
)

View File

@ -3,7 +3,7 @@ package com.marvinelsen.cedict.internal
import com.marvinelsen.cedict.api.CedictDefinition
import com.marvinelsen.cedict.api.CedictEntry
import com.marvinelsen.cedict.api.CedictParser
import com.marvinelsen.chinese.transliteration.Syllable
import com.marvinelsen.chinese.transliteration.api.PinyinSyllable
import java.io.InputStream
internal class RegexCedictParser : CedictParser {
@ -43,8 +43,8 @@ internal class RegexCedictParser : CedictParser {
private fun toPinyinSyllables(pinyinWithNumbers: String) = pinyinWithNumbers
.split(" ")
.filter { Syllable.isValidPinyinWithToneNumberSyllable(it) }
.map { Syllable.fromPinyinWithToneNumber(it) }
.filter { PinyinSyllable.isValidPinyinWithToneNumberSyllable(it) }
.map { PinyinSyllable.fromPinyinWithToneNumber(it) }
private fun toCedictDefinitions(definitions: String) = definitions
.split(DEFINITION_SEPARATOR)

View File

@ -1,8 +1,8 @@
package com.marvinelsen.cedict.internal
import com.marvinelsen.cedict.api.CedictDefinition
import com.marvinelsen.chinese.transliteration.Syllable
import com.marvinelsen.chinese.transliteration.Tone
import com.marvinelsen.chinese.transliteration.api.PinyinSyllable
import com.marvinelsen.chinese.transliteration.api.Tone
import io.kotest.core.spec.style.ShouldSpec
import io.kotest.matchers.shouldBe
import java.util.zip.GZIPInputStream
@ -16,8 +16,8 @@ class RegexCedictParserTest : ShouldSpec({
cedictEntry.traditional shouldBe "皮實"
cedictEntry.simplified shouldBe "皮实"
cedictEntry.pinyinSyllables shouldBe listOf(
Syllable("pi", Tone.SECOND),
Syllable("shi", Tone.FIFTH)
PinyinSyllable("pi", Tone.SECOND),
PinyinSyllable("shi", Tone.FIFTH)
)
cedictEntry.definitions shouldBe listOf(
CedictDefinition(listOf("(of things) durable")),