Compare commits
No commits in common. "5b432776de2441e3fa0dad0279042527d56a18ce" and "b58af68178d840bd70cf16744ec5787b1902486f" have entirely different histories.
5b432776de
...
b58af68178
@ -5,7 +5,7 @@ plugins {
|
|||||||
}
|
}
|
||||||
|
|
||||||
group = "com.marvinelsen"
|
group = "com.marvinelsen"
|
||||||
version = "1.0.0"
|
version = "1.1-SNAPSHOT"
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
|
@ -88,10 +88,6 @@ data class Syllable(
|
|||||||
"'$pinyinSyllableWithoutTone is not a valid Pinyin syllable."
|
"'$pinyinSyllableWithoutTone is not a valid Pinyin syllable."
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pinyinSyllableWithoutTone == "r" && tone == Tone.FIFTH) {
|
|
||||||
return pinyinSyllableWithoutTone
|
|
||||||
}
|
|
||||||
|
|
||||||
val sanitizedPinyinSyllableWithoutTone = pinyinSyllableWithoutTone.replace("v", "ü").replace("u:", "ü")
|
val sanitizedPinyinSyllableWithoutTone = pinyinSyllableWithoutTone.replace("v", "ü").replace("u:", "ü")
|
||||||
|
|
||||||
val characterToIndex = sanitizedPinyinSyllableWithoutTone.withIndex().associate { it.value to it.index }
|
val characterToIndex = sanitizedPinyinSyllableWithoutTone.withIndex().associate { it.value to it.index }
|
||||||
|
@ -17,7 +17,6 @@ class SyllableTest : ShouldSpec({
|
|||||||
"nv3" to Syllable("nv", Tone.THIRD),
|
"nv3" to Syllable("nv", Tone.THIRD),
|
||||||
"nü3" to Syllable("nü", Tone.THIRD),
|
"nü3" to Syllable("nü", Tone.THIRD),
|
||||||
"nu:3" to Syllable("nu:", Tone.THIRD),
|
"nu:3" to Syllable("nu:", Tone.THIRD),
|
||||||
"r5" to Syllable("r", Tone.FIFTH),
|
|
||||||
) { (pinyinWithNumber, expectedSyllable) ->
|
) { (pinyinWithNumber, expectedSyllable) ->
|
||||||
Syllable.fromPinyinWithToneNumber(pinyinWithNumber) shouldBe expectedSyllable
|
Syllable.fromPinyinWithToneNumber(pinyinWithNumber) shouldBe expectedSyllable
|
||||||
}
|
}
|
||||||
@ -55,7 +54,6 @@ class SyllableTest : ShouldSpec({
|
|||||||
Syllable("nü", Tone.THIRD) to "ㄋㄩˇ",
|
Syllable("nü", Tone.THIRD) to "ㄋㄩˇ",
|
||||||
Syllable("nu:", Tone.THIRD) to "ㄋㄩˇ",
|
Syllable("nu:", Tone.THIRD) to "ㄋㄩˇ",
|
||||||
Syllable("nv", Tone.THIRD) to "ㄋㄩˇ",
|
Syllable("nv", Tone.THIRD) to "ㄋㄩˇ",
|
||||||
Syllable("r", Tone.FIFTH) to "˙ㄦ",
|
|
||||||
) { (syllable, expectedZhuyin) ->
|
) { (syllable, expectedZhuyin) ->
|
||||||
syllable.format(TransliterationSystem.ZHUYIN) shouldBe expectedZhuyin
|
syllable.format(TransliterationSystem.ZHUYIN) shouldBe expectedZhuyin
|
||||||
}
|
}
|
||||||
@ -72,7 +70,6 @@ class SyllableTest : ShouldSpec({
|
|||||||
Syllable("nü", Tone.THIRD) to "nü3",
|
Syllable("nü", Tone.THIRD) to "nü3",
|
||||||
Syllable("nu:", Tone.THIRD) to "nu:3",
|
Syllable("nu:", Tone.THIRD) to "nu:3",
|
||||||
Syllable("nv", Tone.THIRD) to "nv3",
|
Syllable("nv", Tone.THIRD) to "nv3",
|
||||||
Syllable("r", Tone.FIFTH) to "r5",
|
|
||||||
) { (syllable, expectedPinyinWithToneNumbers) ->
|
) { (syllable, expectedPinyinWithToneNumbers) ->
|
||||||
syllable.format(TransliterationSystem.PINYIN_WITH_TONE_NUMBERS) shouldBe expectedPinyinWithToneNumbers
|
syllable.format(TransliterationSystem.PINYIN_WITH_TONE_NUMBERS) shouldBe expectedPinyinWithToneNumbers
|
||||||
}
|
}
|
||||||
@ -91,7 +88,6 @@ class SyllableTest : ShouldSpec({
|
|||||||
Syllable("nü", Tone.THIRD) to "nǚ",
|
Syllable("nü", Tone.THIRD) to "nǚ",
|
||||||
Syllable("nu:", Tone.THIRD) to "nǚ",
|
Syllable("nu:", Tone.THIRD) to "nǚ",
|
||||||
Syllable("nv", Tone.THIRD) to "nǚ",
|
Syllable("nv", Tone.THIRD) to "nǚ",
|
||||||
Syllable("r", Tone.FIFTH) to "r",
|
|
||||||
) { (syllable, expectedPinyinWithToneMarks) ->
|
) { (syllable, expectedPinyinWithToneMarks) ->
|
||||||
syllable.format(TransliterationSystem.PINYIN_WITH_TONE_MARKS) shouldBe expectedPinyinWithToneMarks
|
syllable.format(TransliterationSystem.PINYIN_WITH_TONE_MARKS) shouldBe expectedPinyinWithToneMarks
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user