Closed maboroshin closed 1 year ago
The name is correct, official document at https://docs.microsoft.com/en-us/windows/win32/intl/imr-documentfeed
Thank you!
This function is commonly called “Before and after feedback”( 前後フィードバック or 前後参照 ) in Japanese. This is probably not a search hit in English. There seems to be no official information on the details of the structure.
This function should be turned on/off from Notepad2 (via Scintilla's variable). Beacuse, It is written about the bug of IME in 2009. (JP) (But 10 years ago) crash IME : In case IME's dictionary file is broken with IME2002/2003. (JP)
I filled a feature request at https://sourceforge.net/p/scintilla/feature-requests/1310/. It would helpful if there are steps to let IME makes the request.
(Added) This test may not work. It does not seem to retrieve the continuation of the text. It retrieves before the text. See below.
You said "IME makes the request." I thought it was about program code. I made a mistake. Perhaps it's a test.
Scintilla requires testability. But it doesn't work. I tested with Sakura Editor and FireFox. Cannot confirm it.
Contents of Sample.txt
:
が痛い
が咲く
Type "hana" before each Japanese, then press Space (Appearing conversion candidates). The result is the ideal case. Confirm the distinction of HANA.
However, there was no distinction, probably because dictionary learning was prioritized.
I have not tried the clear. I'll try using Macrium Reflect to make the OS recoverable. later.
(Added) However this test did not work in 2023.
I found a good test. Some successful with Sakura editor. Refference site(jp): 1 2
Input: ippatu
. Sample text:
危機
ファイト
Ideal result:
Space
key. Candidates come out.Esc
key. Cenccel candidates. This is important. Learned unless canceled. It learns even with unusual combinations.(Added) This test may not work. It does not seem to retrieve the continuation of the text. It retrieves before the text. See below.
Input: atui
. Sample text:
夏にお茶を飲みながら、本を読む。
Ideal: 暑い夏に熱いお茶を飲みながら、厚い本を読む。
The second "atui" does not succeed in my IME learning
updated feature request at https://sourceforge.net/p/scintilla/feature-requests/1310/. Thanks for the tests.
Thank you.
By the way, IME cancellation. According to https://github.com/zufuliu/notepad2/commit/f75470d5be2dd27c8e05d87adf19fbf7197c87c0, Scintilla will be changed by moving AddWString in the code. Should it be as follows?
if (lParam & GCS_RESULTSTR) {
AddWString(imc.GetCompositionString(GCS_RESULTSTR), CharacterSource::imeResult);
initialCompose = true;
If this is adopted in Scintilla, the behavior of IME will be no different from common software. All that remains is DOCUMENTFEED only. Please upstream this AddWString location
This is now implemented (see https://sourceforge.net/p/scintilla/feature-requests/1310/), please test latest builds (e.g. from https://github.com/zufuliu/notepad2/actions/runs/4901319426).
Nice news! I think it is working. The previously proposed test case did not work. Sorry.
Test Procedure: Notepad2 from 4901319426 above was used. And Notepad3 is scintilla not updated. I used Win10 which I don't use much. And This PC is a clean install once every few months.
I tried with Notepad2. Text 1 and 3 were correct. Text 2 was an error. This (熱い) is a candidate for Text 3. Thus, this feature (IMR_DOCUMENTFEED) may not be powerful.
Only Text 3 is correct when trying with Notepad3. All are "熱い".
I tried again with Notepad2. Text 1 and 3 were correct. Thus, this feature is weak but working.
https://www.youtube.com/watch?v=8-qaEHzaW24 johnsonj says in this video. Works only if text is on the left side : I'm typing a sentence that continues, Instead of injecting it into the previous text. It is the same behavior in other programs. (Chrome, Firefox, EmEditor, Sakura editor)
This test is recommended. In 2023 - 2024, this test case works well for Windows 10.
Another test case from a previous text (https://github.com/zufuliu/notepad2/issues/127#issuecomment-577182528) works well : Refference site(jp): 2
Sample text:
花が
布を
時間を
In my tests, 1 and 3 were correct in Notepad2 above. All failed in Notepad3, Returned 0 (最多) in all cases.
(This case can use "SAKU" instead of "SAITA". SAITA is past tense. It is natural Japanese. But I don't know if the candidate is appropriate.)
IMR_DOCUMENTFEED (I forgot the official name) is useful for Japanese IME (Maybe even in Chinese). However, it is mainly Japanese information. It is also mysterious because there is no official website. I tried to implement it myself last year. It ’s too difficult for me. I give up. I want you to implement it if possible.
This function distinguishes kanji with the same pronunciation. (As explanation. Actually more complicated)
The IME sends the following twice :
msg:WM_IME_REQUEST/wParam:IMR_DOCUMENTFEED
. So catch it :if (wParam == IMR_DOCUMENTFEED)
.lParam:0
.sizeof(RECONVERTSTRING)+lengthOfString(byte, including the terminating zero
).struct { RECONVERTSTRING reconv; TCHAR compstr[n]; };
if (lParam != 0)
Reference site (Japanese) : website 1, website 2, website 3
A single paragraph is sufficient for the length of the string. e.g. SetReconvertStruct() get 50 or 200 characters.
Sample code (Japanese) .