You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
lettext="8年前、東京電力福島第一原発で事故がありました。事故のあと、福島県では、放射線を出す物質で汚れた土や草、木などを取る作業をしています。"print(text)lettokens=Tokenizer.tokenize(text: text)
for t in tokens {letlocale=CFLocaleCreate(kCFAllocatorDefault,CFLocaleIdentifier("japanese"asCFString))lettokenizer=CFStringTokenizerCreate(kCFAllocatorDefault,
t asCFString,CFRangeMake(0, t.count),
kCFStringTokenizerUnitWord,
locale)!
varresult=CFStringTokenizerAdvanceToNextToken(tokenizer)
while result !=.none {letr=CFStringTokenizerCopyCurrentTokenAttribute(tokenizer,
kCFStringTokenizerAttributeLatinTranscription)
if let rr = r {letrrr=(r as!String).applyingTransform(.latinToHiragana, reverse: false)print("\(t) => \(rr) => \(rrr!)")}else{
break
}
result =CFStringTokenizerAdvanceToNextToken(tokenizer)}}
The text was updated successfully, but these errors were encountered: