Fix gradle issues
All checks were successful
Pull Request / build (pull_request) Successful in 1m57s

This commit is contained in:
Marvin Elsen 2024-09-20 12:55:41 +02:00
parent e897dd3c82
commit ba16e25917
Signed by: marvinelsen
GPG Key ID: 820672408CC318C2

View File

@ -2,6 +2,7 @@ package com.marvinelsen.chinese.transliteration
import java.io.InputStream import java.io.InputStream
@Suppress("MagicNumber", "MaximumLineLength", "MaxLineLength")
data class Syllable( data class Syllable(
val pinyinSyllableWithoutTone: String, val pinyinSyllableWithoutTone: String,
val tone: Tone, val tone: Tone,
@ -23,7 +24,6 @@ data class Syllable(
require(lastCharacter.isDigit()) { require(lastCharacter.isDigit()) {
"'$pinyinWithToneNumber' is not a valid Pinyin with tone number syllable. Expected the last character to be a digit, but was '${pinyinWithToneNumber.last()}'" "'$pinyinWithToneNumber' is not a valid Pinyin with tone number syllable. Expected the last character to be a digit, but was '${pinyinWithToneNumber.last()}'"
} }
@Suppress("MagicNumber")
require(lastCharacter.digitToInt() in 1..5) { require(lastCharacter.digitToInt() in 1..5) {
"'$pinyinWithToneNumber' is not a valid Pinyin with tone number syllable. Expected the tone number 'n' to be in range 1 <= n <= 5, but was '${pinyinWithToneNumber.last()}'" "'$pinyinWithToneNumber' is not a valid Pinyin with tone number syllable. Expected the tone number 'n' to be in range 1 <= n <= 5, but was '${pinyinWithToneNumber.last()}'"
} }
@ -45,7 +45,7 @@ data class Syllable(
return Syllable( return Syllable(
zhuyinToPinyin[zhuyinWithoutToneMark]!!, zhuyinToPinyin[zhuyinWithoutToneMark]!!,
Tone.fromZhuyinToneMarkOrNull(zhuyin.last()) ?: Tone.fromZhuyinToneMarkOrNull(zhuyin.first()) Tone.fromZhuyinToneMarkOrNull(zhuyin.last()) ?: Tone.fromZhuyinToneMarkOrNull(zhuyin.first())
?: Tone.FIRST ?: Tone.FIRST
) )
} }