| 32 |
function GetStartWithKeyResistWords(Key: String; var list: TStringList): Integer; |
function GetStartWithKeyResistWords(Key: String; var list: TStringList): Integer; |
| 33 |
//! Keyをカテゴリに持つ登録されている単語を取得 |
//! Keyをカテゴリに持つ登録されている単語を取得 |
| 34 |
function GetStartWithCategoryResistWords(Key: String; var list: TStringList): Integer; |
function GetStartWithCategoryResistWords(Key: String; var list: TStringList): Integer; |
| 35 |
|
//! Keyのカテゴリに登録されている単語を取得 |
| 36 |
|
function GetCategoryResistWords(Key: String; var list: TStringList): Integer; |
| 37 |
|
//! 登録済みキーの全てのカテゴリリスト取得 |
| 38 |
|
procedure GetCategoryList(var list: TStringList); |
| 39 |
|
|
| 40 |
end; |
end; |
| 41 |
|
|
| 42 |
TResistWord = class(TObject) |
TResistWord = class(TObject) |
| 312 |
FDictionary.Sorted := Value; |
FDictionary.Sorted := Value; |
| 313 |
end; |
end; |
| 314 |
end; |
end; |
| 315 |
|
//! Keyのカテゴリに登録されている単語を取得 |
| 316 |
|
function TInputAssistDM.GetCategoryResistWords(Key: String; var list: TStringList): Integer; |
| 317 |
|
var |
| 318 |
|
i : Integer; |
| 319 |
|
resWord : TResistWord; |
| 320 |
|
begin |
| 321 |
|
Result := 0; |
| 322 |
|
if (FDictionary <> nil) and (list <> nil) then begin |
| 323 |
|
for i := 0 to FDictionary.Count - 1 do begin |
| 324 |
|
resWord := TResistWord(FDictionary.Objects[i]); |
| 325 |
|
if (Key = resWord.GetCategory) then begin |
| 326 |
|
Inc(Result); |
| 327 |
|
list.AddObject(resWord.GetKey + '(' + |
| 328 |
|
resWord.GetCategory + ')', resWord); |
| 329 |
|
end; |
| 330 |
|
end; |
| 331 |
|
list.CustomSort(CategorySort); |
| 332 |
|
end; |
| 333 |
|
end; |
| 334 |
|
|
| 335 |
|
//! 登録済みキーの全てのカテゴリリスト取得 |
| 336 |
|
procedure TInputAssistDM.GetCategoryList(var list: TStringList); |
| 337 |
|
var |
| 338 |
|
i : Integer; |
| 339 |
|
begin |
| 340 |
|
if (FDictionary <> nil) and (list <> nil) then begin |
| 341 |
|
// 重複チェックをTStringListの機能で行う |
| 342 |
|
list.Clear; |
| 343 |
|
list.Duplicates := dupIgnore; |
| 344 |
|
list.Sorted := true; |
| 345 |
|
list.BeginUpdate; |
| 346 |
|
for i := 0 to FDictionary.Count - 1 do begin |
| 347 |
|
list.Add(TResistWord(FDictionary.Objects[i]).GetCategory); |
| 348 |
|
end; |
| 349 |
|
list.EndUpdate; |
| 350 |
|
end; |
| 351 |
|
end; |
| 352 |
|
|
| 353 |
//! Keyをカテゴリに持つ登録単語を返す時のソート用比較メソッド |
//! Keyをカテゴリに持つ登録単語を返す時のソート用比較メソッド |
| 354 |
function CategorySort(List: TStringList; Index1, Index2: Integer): Integer; |
function CategorySort(List: TStringList; Index1, Index2: Integer): Integer; |