8bitPit / Niagara-Issues

A place to submit feature requests and bug reports for Niagara Launcher, a modern + minimalist Android home screen optimized for one-✋ access and staying focused.
http://niagaralauncher.app
792 stars 35 forks source link

Chinese pinyin support #234

Closed absir1949 closed 4 years ago

absir1949 commented 5 years ago

just like microsoft lanuacher.

it will combine Letters and Pinyin.

8bitPit commented 5 years ago

I would, but unfortunately I don't know how don't know how that system works, but I will do some research, If anyone can help, please let me know.

OldFanta commented 5 years ago

@8bitPit I think it is a good idea to convert Chinese characters into pinyin first. Pinyin is like an English letter, such as "百度" = "Baidu". Or you can refer to Project(Pinyin), Project(PinyinOrder), Article(Android PinyinOrder) and Article(Android SQL Chinese Order)(sorry I have not studied programming, but those looks reliable.) Anyway, the concept of this launcher is great, thank you for your wonderful job, and look forward to the emergence of Chinese sorting!

fanjl commented 5 years ago

Chinese user need this

powerrun commented 5 years ago

http://pinyin4j.sourceforge.net/ I think this may help you.

8bitPit commented 5 years ago

@xrkxrk sadly, I cannot use your suggested library, since it's licensed under the copyleft GNU license.

8bitPit commented 5 years ago

@OldFanta thanks for your help. However, Pinyin libraries hafe to be written in Java / Kotlin, so they can be used for Android apps.

8bitPit commented 5 years ago

I could use: https://github.com/promeG/TinyPinyin or https://github.com/KyleTang/JPinYin.

OldFanta commented 5 years ago

I could use: https://github.com/promeG/TinyPinyin or https://github.com/KyleTang/JPinYin.

I am very glad to hear this news, thank you very much. Looking forward to seeing in the follow-up update!

powerrun commented 5 years ago

I could use: https://github.com/promeG/TinyPinyin or https://github.com/KyleTang/JPinYin.

Thanks a million, Look forward to your success!

Scofieldsu commented 5 years ago

look forward to your success,and i also expect that searching app can fuzzy query by Chinese Pinyin。

like it very much @8bitPit (づ ̄3 ̄)づ╭❤~

8bitPit commented 5 years ago

@xinkunZ also suggested a library to support pinyin: https://github.com/belerweb/pinyin4j

xinkunZ commented 5 years ago

@8bitPit If you choose pinyin4j to translate app name to pinyin, there is an example

  private String getPinyin(String appName, String defaultName) {
    try {
      HanyuPinyinOutputFormat format = new HanyuPinyinOutputFormat();
      format.setCaseType(HanyuPinyinCaseType.LOWERCASE);
      format.setToneType(HanyuPinyinToneType.WITHOUT_TONE);
      StringBuilder sb = new StringBuilder();
      char[] chars = appName.toCharArray();
      for (char aChar : chars) {
        String[] strings = PinyinHelper.toHanyuPinyinStringArray(aChar, format);
        if (strings != null && strings.length > 0) {
          sb.append(strings[0]);
        } else {
          sb.append(aChar);
        }
      }
      return sb.toString();
    } catch (Exception e) {
      return defaultName;
    }
  }

Really like this launcher!! Thanks!

8bitPit commented 5 years ago

Thanks for helping @xinkunZ :)

Maxr1998 commented 5 years ago

Honestly, TinyPinyin seems to be the best option for me. Especially since it has low memory requirements and is said to be a lot faster. @8bitPit

2236125280 commented 5 years ago

Maybe you can try this https://www.cnblogs.com/goloving/p/7662676.html

8bitPit commented 5 years ago

I've discovered Android has an inbuilt Pinyin transliterator. It is somewhat hidden inside the framework, but I can use it on Android 7 and above. So no library is need, thanks for all your suggestions though.

8bitPit commented 4 years ago

Implemented in v0.9.9: https://github.com/8bitPit/Niagara-Issues/releases