11#ifndef _FEATURE_UTILS_H_
12#define _FEATURE_UTILS_H_
42 static int overlap(
const std::vector<std::string> &v1,
const std::vector<std::string> &v2);
45 static double overlapD(
const std::vector<std::string> &v1,
const std::vector<std::string> &v2);
48 static double levDist(
const std::string &v1,
const std::string &v2);
50 static double jaccard(
const std::vector<std::string> &v1,
const std::vector<std::string> &v2);
51 static double jaccard(
const std::vector<std::string> &v1,
const std::vector<std::string> &v2,
int ovlp);
53 static double cosine(
const std::vector<std::string> &v1,
const std::vector<std::string> &v2);
54 static double cosine(
const std::vector<std::string> &v1,
const std::vector<std::string> &v2,
int ovlp);
56 static double dice(
const std::vector<std::string> &v1,
const std::vector<std::string> &v2);
57 static double dice(
const std::vector<std::string> &v1,
const std::vector<std::string> &v2,
int ovlp);
59 static double overlapCoeff(
const std::vector<std::string> &v1,
const std::vector<std::string> &v2);
60 static double overlapCoeff(
const std::vector<std::string> &v1,
const std::vector<std::string> &v2,
int ovlp);
62 static double exactMatch(
const std::string &s1,
const std::string &s2);
64 static double absoluteNorm(
const std::string &s1,
const std::string &s2);
66 static void stringSplit(std::string str,
char delim, std::vector<std::string> &res);
Definition feature_utils.h:24
static int tripletMin(int a, int b, int c)
Definition feature_utils.cc:39
static void stringSplit(std::string str, char delim, std::vector< std::string > &res)
Definition feature_utils.cc:189
static double jaccard(const std::vector< std::string > &v1, const std::vector< std::string > &v2)
Definition feature_utils.cc:77
static void tokenize(const std::string &str, TokenizerType type, std::vector< std::string > &tokens)
Definition feature_utils.cc:198
static double dice(const std::vector< std::string > &v1, const std::vector< std::string > &v2)
Definition feature_utils.cc:119
static std::string delims
Definition feature_utils.h:26
FeatureUtils(FeatureUtils &&other)=delete
static double exactMatch(const std::string &s1, const std::string &s2)
Definition feature_utils.cc:159
static int overlap(const std::vector< std::string > &v1, const std::vector< std::string > &v2)
Definition feature_utils.cc:11
static double levDist(const std::string &v1, const std::string &v2)
Definition feature_utils.cc:45
static double NaN
Definition feature_utils.h:27
static double overlapD(const std::vector< std::string > &v1, const std::vector< std::string > &v2)
Definition feature_utils.cc:25
static double cosine(const std::vector< std::string > &v1, const std::vector< std::string > &v2)
Definition feature_utils.cc:97
static double overlapCoeff(const std::vector< std::string > &v1, const std::vector< std::string > &v2)
Definition feature_utils.cc:139
static double absoluteNorm(const std::string &s1, const std::string &s2)
Definition feature_utils.cc:168
FeatureUtils(const FeatureUtils &other)=delete
TokenizerType
Definition type.h:39