11#ifndef _FEATURE_INDEX_H_
12#define _FEATURE_INDEX_H_
25 using Group = std::unordered_map<int, std::vector<std::string>>;
26 using Groups = std::vector<std::unordered_map<int, std::vector<std::string>>>;
27 using GroupToken = std::unordered_map<int, std::vector<std::vector<std::string>>>;
28 using GroupTokens = std::vector<std::unordered_map<int, std::vector<std::vector<std::string>>>>;
29 using GroupTokenInt = std::unordered_map<int, std::vector<std::vector<ui>>>;
30 using GroupTokensInt = std::vector<std::unordered_map<int, std::vector<std::vector<ui>>>>;
31 using Cluster = std::vector<std::unordered_map<std::string, int>>;
34 std::vector<std::string>
str_gt_10w = {
"name",
"title",
"description"};
37 std::vector<std::string>
str_eq_1w = {
"brand",
"category",
"manufacturer"};
58 for(
int i = 0; i < attrSize; i++) {
75 int calCahceIndex(
const std::string &func,
const std::string &tok,
int numFeature);
81 void calIndexLength4(
int curAttrIdx,
const std::vector<int> &grpid,
const GroupToken &curGrpDlm,
const GroupTokenInt &curGrpDlmInt,
83 void calIndexLength6(
int curAttrIdx,
const std::vector<int> &grpid,
const Group &curGrp,
const GroupToken &curGrpQgm,
85 void calIndexLength8(
int curAttrIdx,
const std::vector<int> &grpid,
const GroupToken &curGrpDlm,
const GroupTokenInt &curGrpDlmInt,
Definition feature_index.h:20
std::vector< std::string > str_bt_5w_10w
Definition feature_index.h:36
std::vector< std::string > str_bt_1w_5w
Definition feature_index.h:35
const double diceLengthFilter
Definition feature_index.h:52
const double cosLengthFilter
Definition feature_index.h:51
double **** featureValCache
Definition feature_index.h:40
std::vector< std::unordered_map< int, std::vector< std::string > > > Groups
Definition feature_index.h:26
int ** discreteCacheIdx
Definition feature_index.h:41
int calNumFeature(const std::string attr)
Definition feature_index.cc:311
std::unordered_map< int, std::vector< std::vector< std::string > > > GroupToken
Definition feature_index.h:27
std::unordered_map< int, std::vector< std::string > > Group
Definition feature_index.h:25
std::vector< std::unordered_map< std::string, int > > Cluster
Definition feature_index.h:31
void globalInit(const std::vector< int > &keyNum, const std::vector< std::string > &attrs, Groups &groups, const GroupTokens &grpdlm, const GroupTokens &grpqgm, bool isCoeff=false)
Definition feature_index.cc:326
std::vector< std::string > str_gt_10w
Definition feature_index.h:34
FeatureIndex(FeatureIndex &&other)=delete
const double universalDet
Definition feature_index.h:50
std::vector< std::unordered_map< int, std::vector< std::vector< std::string > > > > GroupTokens
Definition feature_index.h:28
FeatureIndex(const FeatureIndex &other)=delete
std::vector< std::string > str_eq_1w
Definition feature_index.h:37
const int MIN_CACHED_LENGTH
Definition feature_index.h:46
std::unordered_map< int, std::vector< std::vector< ui > > > GroupTokenInt
Definition feature_index.h:29
std::vector< std::unordered_map< int, std::vector< std::vector< ui > > > > GroupTokensInt
Definition feature_index.h:30
int calCahceIndex(const std::string &func, const std::string &tok, int numFeature)
Definition feature_index.cc:9
const double LENGTH_FILTER_DET
Definition feature_index.h:48
std::vector< int > attrCahceLength
Definition feature_index.h:43
~FeatureIndex()
Definition feature_index.h:56