从日语IME获取更多数据 [英] Getting more data from the Japanese IME

查看:118
本文介绍了从日语IME获取更多数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的C#表单中,我有一个数据网格视图,我想在此输入单词或句子的汉字和假名版本,并将它们放在不同的列中.例如:

In my c# form I have a data grid view where I want to input both kanji and kana version of a word or sentence, putting them in different columns. For example:

転寝 | うたたね
寝坊 | ねぼう

我想要实现的是在我提交第一列时自动填充第二列. 我知道有些字典包含汉字读物,但对于句子来说却很复杂,而且还有许多汉字读不止一个. 我所知道的是,IME具有这两种信息,因为在键入时我先使用平假名,然后将其转换为汉字,因此,有没有办法获得用户的原始输入?

What I want to achieve is having the second column automatically filled when I commit on the first one. I know there are dictionaries containing kanji readings but for sentences it gets complicated, and also there are many kanji with more than one reading. What I know is that the IME has both informations because while typing I first use hiragana and then convert it to kanji so, is there a way to get the original input of the user?

推荐答案

很遗憾,我很确定您无法从IME获取更多信息.据我了解,它们的设计方式是在用户选择正确的假名/日文汉字之前不输入任何内容.

Unfortunately I'm pretty sure you can't get anymore information from the IME. As I understand it, they are designed in such a way to not enter in anything before the user has selected the correct kana/kanji.

我在玩WinForms应用程序时播放了一些看似有希望的事件,却一无所获.输入由操作系统处理,并在做出选择后交还给应用程序.

I had a play with a WinForms app hooking up any events that looked promising and came back with nothing. The input is handled by the OS and handed back to the application once the selection is made.

我建议您做您不想做的事情,并抓住JMDict或类似的东西,并建立一个包含折纸的内部数据库.最重要的是,您可以在.NET中实现自己的IME,该IME可以接受英文字符输入,并且可以像传统的IME一样发挥作用.

I would suggest doing what you don't want to do and grabbing JMDict or something similar and building an internal database containing the furigana. On top of this you could implement your own IME in .NET that accepts English character input and acts as a traditional IME does.

或者,您可以将应用程序更改为基于Web的应用程序,并使用现有的Javascript IME库像这样的将使您能够在平假名转换之前抓住它.

Alternatively you could change your application to be web based and use an existing javascript IME library like this one which will allow you to grab the hiragana before it is converted.

这篇关于从日语IME获取更多数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆