Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pinyin support #81

Open
ifnk opened this issue Dec 4, 2022 · 11 comments
Open

Pinyin support #81

ifnk opened this issue Dec 4, 2022 · 11 comments
Labels
enhancement New feature or request

Comments

@ifnk
Copy link

ifnk commented Dec 4, 2022

I found that leap can only support English characters ,
can support chinese pinyin ?
here is example
"精确" pin yin is "jing que" so when i press s->j->q , i will find it
leap

In order to implement this, we will need a library a library that can convert Chinese unicode characters to Pinyin:

http://pinyin4j.sourceforge.net/
https://github.com/frapples/java-pinyin
https://github.com/duguying/pinyin
https://github.com/zangsir/Native-to-Pinyin

@ifnk ifnk changed the title can support chinese pinyin can support chinese pinyin ? Dec 4, 2022
@ggandor
Copy link
Owner

ggandor commented Dec 4, 2022

I found that leap can only support English characters

Well, Leap supports any characters if you can input those. I mean, it finds and labels any Unicode characters.

Special support for pinyin "shortcuts" is not something that should be added to Leap itself (only if we could generalize the feature), but some kind of extension plugin might be worth thinking about, yeah.

In order to implement this, we will need a library a library that can convert Chinese unicode characters to Pinyin

I don't see why a library dependency is necessary, all we need is lookup table, isn't it?

On the screen recording, what plugin do you use? Is this IdeaVim?

@yyy33

This comment was marked as off-topic.

@yyy33
Copy link

yyy33 commented Dec 8, 2022

I found that leap can only support English characters

Well, Leap supports any characters if you can input those. I mean, it finds and labels any Unicode characters.

Special support for pinyin "shortcuts" is not something that should be added to Leap itself (only if we could generalize the feature), but some kind of extension plugin might be worth thinking about, yeah.

In order to implement this, we will need a library a library that can convert Chinese unicode characters to Pinyin

I don't see why a library dependency is necessary, all we need is lookup table, isn't it?

On the screen recording, what plugin do you use? Is this IdeaVim?

Hi @ggandor , I am contacting you on reddit yyyy33_,I tried to reply on reddit and failed,this is a library I wrote for converting the initials of Chinese characters to letters,let's say we need to get the initials of '你',first save it as test.lua,then execute require('test').get_hanzi_initial_xiaohe('你') or require('test').get_hanzi_initial('你') ,These two functions will return a table containing the letters '你', the difference between these two functions is that it corresponds to two different Chinese input methods, we can let the user choose which one to use in the configuration, the first one is Xiaohe ShuangPin, the second one is QuanPin

@yyy33
Copy link

yyy33 commented Dec 8, 2022

e

I found that leap can only support English characters

Well, Leap supports any characters if you can input those. I mean, it finds and labels any Unicode characters.

Special support for pinyin "shortcuts" is not something that should be added to Leap itself (only if we could generalize the feature), but some kind of extension plugin might be worth thinking about, yeah.

In order to implement this, we will need a library a library that can convert Chinese unicode characters to Pinyin

I don't see why a library dependency is necessary, all we need is lookup table, isn't it?

On the screen recording, what plugin do you use? Is this IdeaVim?

For neovim lua's missing utf8, you may need it to handle multi-byte text https://github.com/uga-rosa/utf8.nvim

@ggandor ggandor changed the title can support chinese pinyin ? Pinyin support Dec 16, 2022
@ggandor ggandor added the enhancement New feature or request label Feb 17, 2023
@lbgws2
Copy link

lbgws2 commented Jun 26, 2023

@ifnk 请问问题中的示例操作是如何实现的?

@rainzm
Copy link

rainzm commented Jul 21, 2023

It's a good idea, but there should be a lot of work to be done. Another idea of #123 can achieve the same jump effect with the help of the input method of the os.

@kxccc
Copy link

kxccc commented Aug 31, 2023

In the Chinese input method, there is a method called "double pinyin," which allows you to input a pair of English letters to represent a set of Chinese characters. Is it possible to develop a plugin that, after typing in the two English letters, provides the corresponding set of Chinese characters to Leap? A similar plugin exists in Hop.

@rainzm
Copy link

rainzm commented Oct 4, 2023

@kxccc Good idea! I implemented a simple version of the plugin based on flash.nvim.

@noearc
Copy link

noearc commented Nov 25, 2023

I made a plugin to get the double-char jump here leap-zh.nvim
More work needs to be done, now it only support one encoding and only goes to specific char, but I think I solved the problem :)

@ifnk
Copy link
Author

ifnk commented Nov 25, 2023 via email

@noearc
Copy link

noearc commented Nov 25, 2023

哇,谢谢你 ,有这个就能写中文 文档 啦

------------------ 原始邮件 ------------------ 发件人: "ggandor/leap.nvim" @.>; 发送时间: 2023年11月25日(星期六) 下午3:51 @.>; @.@.>; 主题: Re: [ggandor/leap.nvim] Pinyin support (Issue #81) I made a plugin to get the double-char jump here leap-zh.nvim More work needs to be done, now it only support one encoding and only goes to specific char, but I think I solved the problem :) — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

😄 还可以去我主页看看,我在尝试改进用neovim写中文文档的体验,欢迎使用

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

7 participants