~ubuntu-branches/ubuntu/quantal/sunpinyin/quantal

« back to all changes in this revision

Viewing changes to src/ime-core/imi_options.h

  • Committer: Bazaar Package Importer
  • Author(s): Liang Guo
  • Date: 2011-03-15 00:20:57 UTC
  • mfrom: (1.1.2 upstream) (1.2.3 sid)
  • Revision ID: james.westby@ubuntu.com-20110315002057-k8qf3ybnqtuaf0u1
Tags: 2.0.3-2
* Build with prefix=$(DEB_DESTDIR)/usr (Close: #617752)
* Fix FTBFS on SH (Close: #617753)
* Fix FTBFS on MIPSEL.

Show diffs side-by-side

added added

removed removed

Lines of Context:
48
48
#include "userdict.h"
49
49
#include "ic_history.h"
50
50
#include "pinyin/shuangpin_seg.h"
 
51
#include "pinyin/hunpin_seg.h"
51
52
 
52
53
#ifndef SUNPINYIN_USERDATA_DIR_PREFIX
53
54
#define SUNPINYIN_USERDATA_DIR_PREFIX ".sunpinyin"
88
89
    
89
90
    CIMIData             m_coreData;
90
91
    CBigramHistory       m_historyCache;
91
 
    CUserDict            m_userDict;
92
92
    bool                 m_bLoaded;
93
93
    bool                 m_bTried;
94
94
    unsigned             m_csLevel;
98
98
    CGetFullPunctOp      m_getFullPunctOp;
99
99
    std::string          m_data_dir;
100
100
    std::string          m_user_data_dir;
 
101
public:
 
102
    CUserDict            m_userDict;
101
103
};
102
104
 
103
105
typedef SingletonHolder<CSimplifiedChinesePolicy> ASimplifiedChinesePolicy;
191
193
 
192
194
typedef SingletonHolder<CShuangpinSchemePolicy> AShuangpinSchemePolicy;
193
195
 
 
196
struct  CHunpinSchemePolicy: public IConfigurable
 
197
{
 
198
public:
 
199
    CHunpinSchemePolicy();
 
200
    
 
201
    IPySegmentor* createPySegmentor () 
 
202
    {
 
203
        CHunpinSegmentor *pseg = new CHunpinSegmentor (m_shuangpinType);
 
204
        pseg->setGetFuzzySyllablesOp (&m_getFuzzySyllablesOp);
 
205
        return pseg;
 
206
    }
 
207
        
 
208
    void setShuangpinType (EShuangpinType t) {m_shuangpinType = t;}
 
209
        
 
210
    void setFuzzyForwarding (bool enable_fuzzies=true, bool enable_simpler_initials=true)
 
211
    {
 
212
        m_getFuzzySyllablesOp.setEnableFuzzies (enable_fuzzies);
 
213
        m_getFuzzySyllablesOp.setEnableSimplerInitials (enable_simpler_initials);
 
214
    }
 
215
        
 
216
    void clearFuzzyPinyinPairs ()
 
217
        {m_getFuzzySyllablesOp.clearFuzzyMap();}
 
218
        
 
219
    void setFuzzyPinyinPairs (const string_pairs& pairs, bool duplex = true)
 
220
        {m_getFuzzySyllablesOp.initFuzzyMap (pairs, duplex);}
 
221
        
 
222
    virtual bool onConfigChanged(const COptionEvent& event);
 
223
    
 
224
    template<class> friend class SingletonHolder;
 
225
protected:
 
226
    ~CHunpinSchemePolicy () {}
 
227
        
 
228
    EShuangpinType                      m_shuangpinType;
 
229
    CGetFuzzySyllablesOp<CPinyinData>   m_getFuzzySyllablesOp;
 
230
};
 
231
 
 
232
typedef SingletonHolder<CHunpinSchemePolicy> AHunpinSchemePolicy;
 
233
 
194
234
struct CClassicStylePolicy : public IConfigurable
195
235
{
196
236
    CIMIView* createView () {return new CIMIClassicView ();}
258
298
        SHUANGPIN,
259
299
        YUEPIN,
260
300
        ZHUYIN,
 
301
                HUNPIN,
261
302
    } EPyScheme;
262
303
    
263
304
    typedef enum {