0

I'm currently developing an English to Chinese dictionary app to learn iOS development and I'm kind of stuck as to ranking the more commonly used characters in Chinese when the user searches it in pinyin.

My question is: Is there some way that I can use Apple's ranking algorithm for how they rank the Chinese character that come up when pinyin is typed (as they do a pretty good job at producing the right Chinese character)? Or is there some other way whereby I can achieve this?

YellowPillow
  • 4,100
  • 6
  • 31
  • 57

1 Answers1

0

If you want convert Chinese character to pinyin, you may use: CFString​Transform or PinYin4Objc.

If you want first letter of pinyin, you can use pinyinFirstLetter .

If you just sort in Pinyin alphabetical order,you can use

sortedArray = [array sortedArrayUsingSelector:@selector(localizedCaseInsensitiveCompare:)];

Note: Polyphone, place name may not get right.

Edit:

It seems something like auto complete:

How to create an efficient auto-complete?

Implementing Autocomplete in iOS

Hope it can help you.

Community
  • 1
  • 1
NSDeveloper
  • 1,630
  • 15
  • 25
  • I need something that converts the pinyin phrase into the most commonly used Chinese phrase that is associated to that pinyin phrase. For example when `ren` is typed `人` shows up not `任` or `忍` or `認` etc. Is there a way to do this? – YellowPillow Jul 20 '15 at 12:06
  • Maybe it's difficult for the client to implement the algorithm. – NSDeveloper Jul 21 '15 at 15:26