libime
Public Member Functions | List of all members
libime::PinyinCorrectionProfile Class Reference

Class that holds updated Pinyin correction mapping based on correction mapping. More...

#include <libime/pinyin/pinyincorrectionprofile.h>

Public Member Functions

 PinyinCorrectionProfile (BuiltinPinyinCorrectionProfile profile)
 Construct the profile based on builtin layout. More...
 
 PinyinCorrectionProfile (const std::unordered_map< char, std::vector< char >> &mapping)
 Construct the profile based on customized mapping. More...
 
const PinyinMap & pinyinMap () const
 Return the updated pinyin map. More...
 
const std::unordered_map< char, std::vector< char > > & correctionMap () const
 Return the correction mapping. More...
 

Detailed Description

Class that holds updated Pinyin correction mapping based on correction mapping.

Since
1.1.7

Definition at line 37 of file pinyincorrectionprofile.h.

Constructor & Destructor Documentation

◆ PinyinCorrectionProfile() [1/2]

libime::PinyinCorrectionProfile::PinyinCorrectionProfile ( BuiltinPinyinCorrectionProfile  profile)
explicit

Construct the profile based on builtin layout.

Parameters
profilebuilt-in profile

Definition at line 60 of file pinyincorrectionprofile.cpp.

◆ PinyinCorrectionProfile() [2/2]

libime::PinyinCorrectionProfile::PinyinCorrectionProfile ( const std::unordered_map< char, std::vector< char >> &  mapping)
explicit

Construct the profile based on customized mapping.

E.g. w may be corrected to q,e, the mapping will contain {'w': ['q', 'e']}.

Parameters
mappingpinyin character and the corresponding possible wrong key.

Definition at line 64 of file pinyincorrectionprofile.cpp.

Member Function Documentation

◆ correctionMap()

const std::unordered_map< char, std::vector< char > > & libime::PinyinCorrectionProfile::correctionMap ( ) const

Return the correction mapping.

E.g. w may be corrected to q,e, the mapping will contain {'w': ['q', 'e']}.

See also
getPinyinMapV2

Definition at line 106 of file pinyincorrectionprofile.cpp.

◆ pinyinMap()

const PinyinMap & libime::PinyinCorrectionProfile::pinyinMap ( ) const

Return the updated pinyin map.

New entries will be marked with PinyinFuzzyFlag::Correction

See also
getPinyinMapV2

Definition at line 100 of file pinyincorrectionprofile.cpp.


The documentation for this class was generated from the following files: