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

vsc插件实现拼音输入法 #53

Closed
nobodxbodon opened this issue Jan 6, 2018 · 27 comments
Closed

vsc插件实现拼音输入法 #53

nobodxbodon opened this issue Jan 6, 2018 · 27 comments
Assignees
Labels
active 不一定活跃,但没有弃坑 web 前端/js/typescript 输入法 keyboard input method engine
Milestone

Comments

@nobodxbodon
Copy link
Member

源自#52 (comment). @htwx 辛苦! 我之前略微尝试了vsc语言服务器实现自动补全, 结果连完整的演示都没跑出来 :< 非常期待你的分享! 如果你没空, 到时我可以写篇专栏文作介绍.

看到每个词语确定用的空格也被输入了, 这个不会影响使用吗?

@nobodxbodon
Copy link
Member Author

@farteryhr 新开此贴讨论这个插件. 省得那个帖歪楼 :)

更需要的还是把标识符的首字拼音提出来匹配(我还没看过vscode的API,这个获取可用标识符列表应该是自动补全的核心吧,库应该有提供吧)

为了尝试自动补全, 之前看了点官方文档, 好像在提示时默认是英文字符匹配, 还没琢磨出怎样匹配拼音输入. @lightrabbit @cleverdango

至于首次输入我觉得……还是交给拼音输入法吧……

个人觉得, 短期内借助外部输入法也许是权宜之计. 但在IDE中集成输入法在长远来说还是很有价值的, 代码输入的很多辅助功能感觉最好是由IDE自带的输入法集成(最直接的比如中文关键字在字库中排列靠前等等), 毕竟外部各种输入法参差不齐, 很难顾及全部.

@htwx
Copy link

htwx commented Jan 7, 2018

vscode 有完善的 插件系统 专门针对各种编程语言的 所以 智能感知 很容易实现的 现在 微软开源了 语言服务 和 语言服务客户端 写个 智能提示 不是大问题

@nobodxbodon
Copy link
Member Author

@htwx 请问最近有何进展? 如果有可能的话, 希望早日开源, 以便其他有兴趣的成员跟进.

@htwx
Copy link

htwx commented Jan 25, 2018

最近正在 翻译支持库 输入法 我是用 CTS 开发的

@htwx
Copy link

htwx commented Jan 25, 2018

这几天 我发到这里来

@htwx
Copy link

htwx commented Jan 25, 2018

temp2222
temp22

@nobodxbodon
Copy link
Member Author

大赞!这几天尽快试用。辛苦啦!

@htwx
Copy link

htwx commented Jan 25, 2018

今天网络不好啊 初始个库怎么这么慢

@nobodxbodon
Copy link
Member Author

初始库?是说git init吗?

@nobodxbodon
Copy link
Member Author

@htwx 刚试着在vscode里运行, 这里的调试输出有些不同:
screen shot 2018-01-27 at 1 51 33 pm
选择继续运行后, 在"主程序.cts"中输入英文(比如'daoru'), 但都没有弹出自动补全. 请问这个插件需要什么外部依赖吗? 比如安装CTS?

@lightrabbit
Copy link

CTS是一个单独的项目吗?看起来好像是把TS中的标识符给中文化了?

@htwx
Copy link

htwx commented Jan 28, 2018

这个 不是cts的插件是 输入法插件的 服务端部分 cts的 拼音 补全是 cts 语言服务插件里面实现的

@htwx
Copy link

htwx commented Jan 28, 2018

cts 是 汉化版本的 ts 从 编译器 到 ide 插件

@htwx
Copy link

htwx commented Jan 28, 2018

你看看 词库文件是不是 没带上

@htwx
Copy link

htwx commented Jan 28, 2018

bg_3ss7n 9tu g 98k rya

@nobodxbodon
Copy link
Member Author

@htwx 不好意思竟然错过了帖子更新! 词库好像都在:
screen shot 2018-01-31 at 10 08 47 am

刚试着调试, 好像在判断是否全拼的时候出了问题, 导致最后用了h'g搜索:
screen shot 2018-01-31 at 10 00 33 am

@nobodxbodon
Copy link
Member Author

@htwx 继续调试如下(未完). 不知是否对诊断有用. 另外, 不知cts或者ts一般如何编写测试用例?

screen shot 2018-01-31 at 7 48 35 pm
screen shot 2018-01-31 at 7 51 48 pm
screen shot 2018-01-31 at 7 54 39 pm
screen shot 2018-01-31 at 7 56 34 pm
screen shot 2018-01-31 at 7 57 04 pm
screen shot 2018-01-31 at 7 57 44 pm
screen shot 2018-01-31 at 7 58 15 pm
screen shot 2018-01-31 at 7 58 56 pm
screen shot 2018-01-31 at 8 04 06 pm
screen shot 2018-01-31 at 8 04 38 pm

@nobodxbodon
Copy link
Member Author

nobodxbodon commented Feb 2, 2018

@htwx 调试进展: 初步确定是由于在分行读取词典文件时, 使用了"\r\n"分割, 但是(猜测是由于git上传时去掉了"\r")我本地的词典文件行末只有"\n". 导致"基础词库"完全没有被读入.

@htwx
Copy link

htwx commented Feb 3, 2018

你是什么系统? 现在是输出前5个词 可以输入 加减号.

@htwx
Copy link

htwx commented Feb 3, 2018

9q 6 9728hjx_3 f 7k3t6k
e6 _e1qhy _8cp k7 6 v
f 8d k27k 17vs x uw9

@htwx
Copy link

htwx commented Feb 3, 2018

nwo6 lwd0c ddznx pkva

@htwx
Copy link

htwx commented Feb 3, 2018

t dg 5xzdczw b41zet c

@nobodxbodon
Copy link
Member Author

加减号的意思是? 为避免这帖太长, 在项目里提了对应的两个问题(读取词典, 返回5个).

@nobodxbodon
Copy link
Member Author

也许可供参考, ローマ字入力時の日本語識別子入力補完プラグインの 開発开发了辅助插件以改进IDE对输入日语命名的支持:

In this research, we develop a plug-in that reduces the burden on programmers when input Japanese identifier. The complication of software development projects in recent years has increased the time cost of maintaining software. So it is important to increase the readability of source code in order to reduce costs. There are several reports that it is useful to write the identi er names of variables and functions in Japanese as one way to increase the readability of source codes. However, when input Japanese identifier, there are some problems to struggle for programmers: the character conversion is troublesome and the input completion is not effective. In this research, we attempt two kinds of methods, one using Migemo and one using morphological analysis, to develop a plug-in that realizes incremental search for Japanese identi ers even if Romaji input mode, and to solve above problems.

@4b5ent1 4b5ent1 added web 前端/js/typescript active 不一定活跃,但没有弃坑 labels Dec 8, 2018
@nobodxbodon nobodxbodon mentioned this issue Jan 28, 2019
61 tasks
@nobodxbodon
Copy link
Member Author

源自此问, 发现这个JS实现的本地输入法: sxei/pinyinjs, 也许可参考其字库和实现.

@nobodxbodon
Copy link
Member Author

@lsby 先把参考资料留着:
https://github.com/zyctree/vscode-google-pinyin

另可参考易语言内置输入法功能:
输入法_易语言
待确认问题:

  • 是否/如何与 IDE 的补全功能集成,比如选字等等
  • 中英混输比如get名称

@nobodxbodon
Copy link
Member Author

@lsby 已于 此插件 实现拼音输入。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
active 不一定活跃,但没有弃坑 web 前端/js/typescript 输入法 keyboard input method engine
Projects
None yet
Development

No branches or pull requests

4 participants