diff --git a/HanziPinyin/PinyinFormatter.swift b/HanziPinyin/PinyinFormatter.swift index 36d6cde..9aba5d6 100644 --- a/HanziPinyin/PinyinFormatter.swift +++ b/HanziPinyin/PinyinFormatter.swift @@ -29,9 +29,9 @@ internal struct PinyinFormatter { } switch format.caseType { - case .lowercase: + case .lowercased: formattedPinyin = formattedPinyin.lowercased() - case .uppercase: + case .uppercased: formattedPinyin = formattedPinyin.uppercased() case .capitalized: formattedPinyin = formattedPinyin.capitalized diff --git a/HanziPinyin/PinyinOutputFormat.swift b/HanziPinyin/PinyinOutputFormat.swift index 61b827b..b1d9041 100644 --- a/HanziPinyin/PinyinOutputFormat.swift +++ b/HanziPinyin/PinyinOutputFormat.swift @@ -20,8 +20,8 @@ public enum PinyinVCharType { } public enum PinyinCaseType { - case lowercase - case uppercase + case lowercased + case uppercased case capitalized } @@ -31,7 +31,7 @@ public struct PinyinOutputFormat { public var caseType: PinyinCaseType public static var `default`: PinyinOutputFormat { - return PinyinOutputFormat(toneType: .none, vCharType: .vCharacter, caseType: .lowercase) + return PinyinOutputFormat(toneType: .none, vCharType: .vCharacter, caseType: .lowercased) } public init(toneType: PinyinToneType, vCharType: PinyinVCharType, caseType: PinyinCaseType) { diff --git a/README.md b/README.md index 551348e..f1aa79f 100644 --- a/README.md +++ b/README.md @@ -15,8 +15,8 @@ github "teambition/HanziPinyin" ```swift // PinyinToneType: none, toneNumber // PinyinVCharType: vCharacter, uUnicode, uAndColon -// PinyinCaseType: lowercase, uppercase -let outputFormat = PinyinOutputFormat(toneType: .none, vCharType: .vCharacter, caseType: .lowercase) +// PinyinCaseType: lowercased, uppercased, capitalized +let outputFormat = PinyinOutputFormat(toneType: .none, vCharType: .vCharacter, caseType: .lowercased) ``` #### Convert to Pinyin synchronously ```swift