-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathBaseDictionaryEngine.h
40 lines (32 loc) · 1.24 KB
/
BaseDictionaryEngine.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
// PARTICULAR PURPOSE.
//
// Copyright (c) Microsoft Corporation. All rights reserved
#pragma once
#include "File.h"
#include "SampleIMEBaseStructure.h"
class CBaseDictionaryEngine
{
public:
CBaseDictionaryEngine(LCID locale, _In_ CFile *pDictionaryFile);
virtual ~CBaseDictionaryEngine();
virtual VOID CollectWord(_In_ CStringRange *psrgKeyCode, _Out_ CSampleImeArray<CStringRange> *pasrgWordString)
{
psrgKeyCode;
pasrgWordString = nullptr;
}
virtual VOID CollectWord(_In_ CStringRange *psrgKeyCode, _Out_ CSampleImeArray<CCandidateListItem> *pItemList)
{
psrgKeyCode;
pItemList = nullptr;
}
virtual VOID SortListItemByFindKeyCode(_Inout_ CSampleImeArray<CCandidateListItem> *pItemList);
protected:
CFile *_pDictionaryFile;
LCID _locale;
private:
VOID MergeSortByFindKeyCode(_Inout_ CSampleImeArray<CCandidateListItem> *pItemList, int leftRange, int rightRange);
int CalculateCandidateCount(int leftRange, int rightRange);
};