Skip to content

Commit

Permalink
1.8.11
Browse files Browse the repository at this point in the history
・動作オプション「送りあり変換で送りなし候補も検索する」を追加しました。
 ・送りあり変換のとき送りありの候補に加え送りなしの候補も検索します。
 ・デフォルトでサ行の活用、init.luaのenable_skk_search_sagyo_onlyがfalseのとき全ての活用で有効となります。

・片仮名変換した候補がユーザー辞書に登録されないバグを修正しました。

・SKK辞書のリストで上下移動したときにチェックボックスが追従していなかったバグを修正しました。
  • Loading branch information
nathancorvussolis committed Jul 7, 2015
1 parent e13045d commit 283801b
Show file tree
Hide file tree
Showing 27 changed files with 150 additions and 73 deletions.
2 changes: 2 additions & 0 deletions LICENSE.TXT
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ License:

Lua

The MIT License

Copyright (C) 1994-2015 Lua.org, PUC-Rio.

Permission is hereby granted, free of charge, to any person obtaining
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

# CorvusSKK ver. 1.8.10
# CorvusSKK ver. 1.8.11

Windowsで動作するSKK風のIMEです。

Expand Down Expand Up @@ -166,6 +166,7 @@ SKK辞書のダウンロード機能では HTTP, HTTPS が使用可能です。
| 送り仮名が決定したとき変換を開始する | 送り仮名を入力したとき自動的に変換を開始します。接頭辞も同様です。 |
| 送り仮名が一致した候補を優先する | 送り仮名ブロックの送り仮名が一致する候補を優先して出力します。 |
| 送り仮名で撥音を送り出す | 送り仮名入力開始後の変換位置指定を含む「な/にゃ」行の入力で「ん」を送り出します。<br>例) ON:「NoNO」→「▽の\*んお」/ OFF:「NoNO」→「▽の\*の」 |
| 送りあり変換で送りなし候補も検索する | 送りあり変換のとき送りありの候補に加え送りなしの候補も検索します。<br>デフォルトでサ行の活用のみ<br>init.luaのenable_skk_search_sagyo_onlyがfalseのとき全ての活用 |
| 取消のとき変換位置を削除する | ▼モードから▽モードに遷移する際、送り仮名の位置情報を削除します。 |
| 取消のとき送り仮名を削除する | ▼モードから▽モードに遷移する際、送り仮名の部分を削除します。 |
| 後退に確定を含める | ▼モードのとき後退すると一文字削除した上で確定します。<br>OFFでは▼モードのとき後退は前候補と同じ機能を有します。 |
Expand Down
1 change: 1 addition & 0 deletions common/configxml.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ LPCWSTR ValueDefModeAscii = L"defmodeascii";
LPCWSTR ValueBeginCvOkuri = L"begincvokuri";
LPCWSTR ValuePrecedeOkuri = L"precedeokuri";
LPCWSTR ValueShiftNNOkuri = L"shiftnnokuri";
LPCWSTR ValueSrchAllOkuri = L"srchallokuri";
LPCWSTR ValueDelCvPosCncl = L"delcvposcncl";
LPCWSTR ValueDelOkuriCncl = L"delokuricncl";
LPCWSTR ValueBackIncEnter = L"backincenter";
Expand Down
1 change: 1 addition & 0 deletions common/configxml.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ extern LPCWSTR ValueDefModeAscii;
extern LPCWSTR ValueBeginCvOkuri;
extern LPCWSTR ValuePrecedeOkuri;
extern LPCWSTR ValueShiftNNOkuri;
extern LPCWSTR ValueSrchAllOkuri;
extern LPCWSTR ValueDelCvPosCncl;
extern LPCWSTR ValueDelOkuriCncl;
extern LPCWSTR ValueBackIncEnter;
Expand Down
6 changes: 3 additions & 3 deletions common/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#define VERSION_H

#define TEXTSERVICE_NAME L"CorvusSKK"
#define TEXTSERVICE_VER L"1.8.10"
#define TEXTSERVICE_VER L"1.8.11"

#ifndef _DEBUG
#define TEXTSERVICE_DESC TEXTSERVICE_NAME
Expand All @@ -14,7 +14,7 @@
//for resource
#define RC_AUTHOR "nathancorvussolis"
#define RC_PRODUCT "CorvusSKK"
#define RC_VERSION "1.8.10"
#define RC_VERSION_D 1,8,10,0
#define RC_VERSION "1.8.11"
#define RC_VERSION_D 1,8,11,0

#endif
3 changes: 3 additions & 0 deletions imcrvcnf/DlgProcBehavior.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ INT_PTR CALLBACK DlgProcBehavior(HWND hDlg, UINT message, WPARAM wParam, LPARAM
LoadCheckButton(hDlg, IDC_CHECKBOX_BEGINCVOKURI, SectionBehavior, ValueBeginCvOkuri, L"1");
LoadCheckButton(hDlg, IDC_CHECKBOX_PRECEDEOKURI, SectionBehavior, ValuePrecedeOkuri);
LoadCheckButton(hDlg, IDC_CHECKBOX_SHIFTNNOKURI, SectionBehavior, ValueShiftNNOkuri, L"1");
LoadCheckButton(hDlg, IDC_CHECKBOX_SRCHALLOKURI, SectionBehavior, ValueSrchAllOkuri);
LoadCheckButton(hDlg, IDC_CHECKBOX_DELCVPOSCNCL, SectionBehavior, ValueDelCvPosCncl, L"1");
LoadCheckButton(hDlg, IDC_CHECKBOX_DELOKURICNCL, SectionBehavior, ValueDelOkuriCncl);
LoadCheckButton(hDlg, IDC_CHECKBOX_BACKINCENTER, SectionBehavior, ValueBackIncEnter, L"1");
Expand All @@ -37,6 +38,7 @@ INT_PTR CALLBACK DlgProcBehavior(HWND hDlg, UINT message, WPARAM wParam, LPARAM
case IDC_CHECKBOX_BEGINCVOKURI:
case IDC_CHECKBOX_PRECEDEOKURI:
case IDC_CHECKBOX_SHIFTNNOKURI:
case IDC_CHECKBOX_SRCHALLOKURI:
case IDC_CHECKBOX_DELCVPOSCNCL:
case IDC_CHECKBOX_DELOKURICNCL:
case IDC_CHECKBOX_BACKINCENTER:
Expand Down Expand Up @@ -66,6 +68,7 @@ INT_PTR CALLBACK DlgProcBehavior(HWND hDlg, UINT message, WPARAM wParam, LPARAM
SaveCheckButton(hDlg, IDC_CHECKBOX_BEGINCVOKURI, ValueBeginCvOkuri);
SaveCheckButton(hDlg, IDC_CHECKBOX_PRECEDEOKURI, ValuePrecedeOkuri);
SaveCheckButton(hDlg, IDC_CHECKBOX_SHIFTNNOKURI, ValueShiftNNOkuri);
SaveCheckButton(hDlg, IDC_CHECKBOX_SRCHALLOKURI, ValueSrchAllOkuri);
SaveCheckButton(hDlg, IDC_CHECKBOX_DELCVPOSCNCL, ValueDelCvPosCncl);
SaveCheckButton(hDlg, IDC_CHECKBOX_DELOKURICNCL, ValueDelOkuriCncl);
SaveCheckButton(hDlg, IDC_CHECKBOX_BACKINCENTER, ValueBackIncEnter);
Expand Down
22 changes: 18 additions & 4 deletions imcrvcnf/DlgProcDictionary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ INT_PTR CALLBACK DlgProcDictionary(HWND hDlg, UINT message, WPARAM wParam, LPARA
OPENFILENAMEW ofn;
WCHAR path[MAX_PATH];
WCHAR pathBak[MAX_PATH];
BOOL check;
BOOL checkBak;
WCHAR num[32];
WCHAR host[MAX_SKKSERVER_HOST];
WCHAR port[MAX_SKKSERVER_PORT];
Expand Down Expand Up @@ -76,10 +78,16 @@ INT_PTR CALLBACK DlgProcDictionary(HWND hDlg, UINT message, WPARAM wParam, LPARA
PropSheet_Changed(GetParent(hDlg), hDlg);

ListView_GetItemText(hWndListView, index - 1, 0, pathBak, _countof(pathBak));
checkBak = ListView_GetCheckState(hWndListView, index - 1);
ListView_GetItemText(hWndListView, index, 0, path, _countof(path));
check = ListView_GetCheckState(hWndListView, index);

ListView_SetItemText(hWndListView, index - 1, 0, path);
ListView_SetCheckState(hWndListView, index - 1, check);
ListView_SetItemText(hWndListView, index, 0, pathBak);
ListView_SetItemState(hWndListView, index - 1, LVIS_FOCUSED | LVIS_SELECTED, 0x000F);
ListView_SetCheckState(hWndListView, index, checkBak);

ListView_SetItemState(hWndListView, index - 1, LVIS_FOCUSED | LVIS_SELECTED, LVIS_FOCUSED | LVIS_SELECTED);
ListView_EnsureVisible(hWndListView, index - 1, FALSE);
}
return TRUE;
Expand All @@ -92,10 +100,16 @@ INT_PTR CALLBACK DlgProcDictionary(HWND hDlg, UINT message, WPARAM wParam, LPARA
PropSheet_Changed(GetParent(hDlg), hDlg);

ListView_GetItemText(hWndListView, index + 1, 0, pathBak, _countof(pathBak));
checkBak = ListView_GetCheckState(hWndListView, index + 1);
ListView_GetItemText(hWndListView, index, 0, path, _countof(path));
check = ListView_GetCheckState(hWndListView, index);

ListView_SetItemText(hWndListView, index + 1, 0, path);
ListView_SetCheckState(hWndListView, index + 1, check);
ListView_SetItemText(hWndListView, index, 0, pathBak);
ListView_SetItemState(hWndListView, index + 1, LVIS_FOCUSED | LVIS_SELECTED, 0x000F);
ListView_SetCheckState(hWndListView, index, checkBak);

ListView_SetItemState(hWndListView, index + 1, LVIS_FOCUSED | LVIS_SELECTED, LVIS_FOCUSED | LVIS_SELECTED);
ListView_EnsureVisible(hWndListView, index + 1, FALSE);
}
return TRUE;
Expand Down Expand Up @@ -128,7 +142,7 @@ INT_PTR CALLBACK DlgProcDictionary(HWND hDlg, UINT message, WPARAM wParam, LPARA
item.iItem = index;
item.iSubItem = 0;
ListView_InsertItem(hWndListView, &item);
ListView_SetItemState(hWndListView, index, LVIS_FOCUSED | LVIS_SELECTED, 0x000F);
ListView_SetItemState(hWndListView, index, LVIS_FOCUSED | LVIS_SELECTED, LVIS_FOCUSED | LVIS_SELECTED);
ListView_SetColumnWidth(hWndListView, 0, LVSCW_AUTOSIZE);
ListView_SetCheckState(hWndListView, index, TRUE);
ListView_EnsureVisible(hWndListView, index, FALSE);
Expand Down Expand Up @@ -161,7 +175,7 @@ INT_PTR CALLBACK DlgProcDictionary(HWND hDlg, UINT message, WPARAM wParam, LPARA
item.iItem = index;
item.iSubItem = 0;
ListView_InsertItem(hWndListView, &item);
ListView_SetItemState(hWndListView, index, LVIS_FOCUSED | LVIS_SELECTED, 0x000F);
ListView_SetItemState(hWndListView, index, LVIS_FOCUSED | LVIS_SELECTED, LVIS_FOCUSED | LVIS_SELECTED);
ListView_SetColumnWidth(hWndListView, 0, LVSCW_AUTOSIZE);
ListView_SetCheckState(hWndListView, index, TRUE);
ListView_EnsureVisible(hWndListView, index, FALSE);
Expand Down
Binary file modified imcrvcnf/imcrvcnf.rc
Binary file not shown.
17 changes: 9 additions & 8 deletions imcrvcnf/resource.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,15 @@
#define IDC_CHECKBOX_BEGINCVOKURI 1204
#define IDC_CHECKBOX_PRECEDEOKURI 1205
#define IDC_CHECKBOX_SHIFTNNOKURI 1206
#define IDC_CHECKBOX_DELCVPOSCNCL 1207
#define IDC_CHECKBOX_DELOKURICNCL 1208
#define IDC_CHECKBOX_BACKINCENTER 1209
#define IDC_CHECKBOX_ADDCANDKTKN 1210
#define IDC_CHECKBOX_STACOMPMULTI 1211
#define IDC_CHECKBOX_DYNAMINCOMP 1212
#define IDC_CHECKBOX_DYNCOMPMULTI 1213
#define IDC_CHECKBOX_COMPUSERDIC 1214
#define IDC_CHECKBOX_SRCHALLOKURI 1207
#define IDC_CHECKBOX_DELCVPOSCNCL 1208
#define IDC_CHECKBOX_DELOKURICNCL 1209
#define IDC_CHECKBOX_BACKINCENTER 1210
#define IDC_CHECKBOX_ADDCANDKTKN 1211
#define IDC_CHECKBOX_STACOMPMULTI 1212
#define IDC_CHECKBOX_DYNAMINCOMP 1213
#define IDC_CHECKBOX_DYNCOMPMULTI 1214
#define IDC_CHECKBOX_COMPUSERDIC 1215

#define IDC_EDIT_FONTNAME 2001
#define IDC_EDIT_FONTPOINT 2002
Expand Down
1 change: 1 addition & 0 deletions imcrvtip/FnConfigure.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ void CTextService::_LoadBehavior()

_ReadBoolValue(SectionBehavior, ValueBeginCvOkuri, cx_begincvokuri, TRUE);
_ReadBoolValue(SectionBehavior, ValueShiftNNOkuri, cx_shiftnnokuri, TRUE);
_ReadBoolValue(SectionBehavior, ValueSrchAllOkuri, cx_srchallokuri, FALSE);
_ReadBoolValue(SectionBehavior, ValueDelCvPosCncl, cx_delcvposcncl, TRUE);
_ReadBoolValue(SectionBehavior, ValueDelOkuriCncl, cx_delokuricncl, FALSE);
_ReadBoolValue(SectionBehavior, ValueBackIncEnter, cx_backincenter, TRUE);
Expand Down
68 changes: 53 additions & 15 deletions imcrvtip/KeyHandlerConv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,41 @@ void CTextService::_StartSubConv(WCHAR command)
//通常検索
_SearchDic(command);

if(cx_srchallokuri && okuriidx != 0)
{
candidates_bak = candidates;
candidates.clear();
candidates.shrink_to_fit();

searchkey.pop_back();

//送りなしエントリ検索
_SearchDic(command);

searchkey = searchkeyorg;

//重複候補を削除
FORWARD_ITERATION_I(candidates_bak_itr, candidates_bak)
{
FORWARD_ITERATION(candidates_itr, candidates)
{
if(candidates_itr->first.first == candidates_bak_itr->first.first)
{
candidates_itr = candidates.erase(candidates_itr);
}
else
{
++candidates_itr;
}
}
}

if(!candidates_bak.empty())
{
candidates.insert(candidates.begin(), candidates_bak.begin(), candidates_bak.end());
}
}

//片仮名変換
if(cx_addcandktkn && !abbrevmode)
{
Expand All @@ -348,13 +383,31 @@ void CTextService::_StartSubConv(WCHAR command)
{
_ConvKanaToKana(kana, inputmode, kanaconv, im_katakana);
}

if(!kanaconv.empty())
{
FORWARD_ITERATION_I(candidates_itr, candidates)
{
if(candidates_itr->first.first == kanaconv)
{
kanaconv.clear();
break;
}
}

if(!kanaconv.empty())
{
candidates.push_back(CANDIDATE(CANDIDATEBASE(kanaconv, L""), CANDIDATEBASE(kanaconv, L"")));
}
}
break;
default:
break;
}
}

candorgcnt = candidates.size();

candidates_bak = candidates;
candidates.clear();
candidates.shrink_to_fit();
Expand Down Expand Up @@ -396,21 +449,6 @@ void CTextService::_StartSubConv(WCHAR command)
{
candidates.insert(candidates.end(), candidates_num.begin(), candidates_num.end());
}
if(!kanaconv.empty())
{
FORWARD_ITERATION_I(candidates_itr, candidates)
{
if(candidates_itr->first.first == kanaconv)
{
kanaconv.clear();
break;
}
}
if(!kanaconv.empty())
{
candidates.push_back(CANDIDATE(CANDIDATEBASE(kanaconv, L""), CANDIDATEBASE(kanaconv, L"")));
}
}

candidx = 0;
}
Expand Down
46 changes: 17 additions & 29 deletions imcrvtip/KeyHandlerDictionary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@ void CTextService::_DisconnectDic()
void CTextService::_SearchDic(WCHAR command)
{
DWORD bytesWrite, bytesRead;
size_t i, icd, icr, iad, iar;
std::wstring s, scd, scr, sad, sar, okurikey;
std::wstring s, se, fmt, scd, scr, sad, sar, okurikey;
std::wregex r;
std::wsmatch m;

_StartManager();

Expand Down Expand Up @@ -80,34 +81,22 @@ void CTextService::_SearchDic(WCHAR command)
}

s.assign(pipebuf);
i = 1;
r.assign(L"(.*)\t(.*)\t(.*)\t(.*)\n");

while(true)
while(std::regex_search(s, m, r))
{
icd = s.find_first_of(L'\t', i + 1);
if(icd == std::wstring::npos)
{
break;
}
icr = s.find_first_of(L'\t', icd + 1);
if(icr == std::wstring::npos)
{
break;
}
iad = s.find_first_of(L'\t', icr + 1);
if(iad == std::wstring::npos)
{
break;
}
iar = s.find_first_of(L'\n', iad + 1);
if(iar == std::wstring::npos)
{
break;
}
scd = s.substr(i + 1, icd - (i + 1));
scr = s.substr(icd + 1, icr - (icd + 1));
sad = s.substr(icr + 1, iad - (icr + 1));
sar = s.substr(iad + 1, iar - (iad + 1));
se = m.str();
s = m.suffix();

fmt.assign(L"$1");
scd = std::regex_replace(se, r, fmt);
fmt.assign(L"$2");
scr = std::regex_replace(se, r, fmt);
fmt.assign(L"$3");
sad = std::regex_replace(se, r, fmt);
fmt.assign(L"$4");
sar = std::regex_replace(se, r, fmt);

if(scd.empty())
{
scd = scr;
Expand All @@ -118,7 +107,6 @@ void CTextService::_SearchDic(WCHAR command)
}

candidates.push_back(CANDIDATE(CANDIDATEBASE(scd, sad), CANDIDATEBASE(scr, sar)));
i = iar;
}

exit:
Expand Down
1 change: 1 addition & 0 deletions imcrvtip/TextService.h
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,7 @@ class CTextService :

BOOL cx_begincvokuri; //送り仮名が決定したとき変換を開始する
BOOL cx_shiftnnokuri; //送り仮名で撥音を送り出す
BOOL cx_srchallokuri; //送りあり変換で送りなし候補も検索する
BOOL cx_delcvposcncl; //取消のとき変換位置を削除する
BOOL cx_delokuricncl; //取消のとき送り仮名を削除する
BOOL cx_backincenter; //後退に確定を含める
Expand Down
4 changes: 2 additions & 2 deletions installer/README.TXT
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

==============================================================================

CorvusSKK ver. 1.8.10
CorvusSKK ver. 1.8.11

https://nathancorvussolis.github.io/
[email protected]
Expand All @@ -23,6 +23,6 @@

マニュアル

https://github.com/nathancorvussolis/corvusskk/blob/1.8.10/README.md
https://github.com/nathancorvussolis/corvusskk/blob/1.8.11/README.md

==============================================================================
4 changes: 2 additions & 2 deletions installer/_mkarc.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ pushd config-sample
7za.exe a -tzip -mtc=off "..\%TARGETDIR%\config-sample.zip" *.xml *.txt
popd

del "%TARGETDIR%\corvusskk.zip"
del "%TARGETDIR%\corvusskk-%VERSION%.zip"

pushd "%TARGETDIR%"
7za.exe a -tzip -mtc=off corvusskk-%VERSION%.zip corvusskk-*.msi ..\README.TXT ..\..\LICENSE.TXT config-sample.zip
7za.exe a -tzip -mtc=off corvusskk-%VERSION%.zip corvusskk-%VERSION%-x64.msi corvusskk-%VERSION%-x86.msi ..\README.TXT ..\..\LICENSE.TXT config-sample.zip
popd

popd
Expand Down
2 changes: 1 addition & 1 deletion installer/_version.cmd
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@

set VERSION=1.8.10
set VERSION=1.8.11
Loading

0 comments on commit 283801b

Please sign in to comment.