back to scratko.xyz
aboutsummaryrefslogtreecommitdiff
path: root/utilities.h
blob: ca0240b5abde4bcee3c65497a20c55c6354684b9 (plain)
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
#ifndef UTILITIES_H
#define UTILITIES_H

#endif // UTILITIES_H

#include <string>
#include <vector>
#include <algorithm>
#include <map>
#include <cctype>
#include <set>
#include <map>
#include <iostream>
#include <fstream>
#include <cmath>
#define BOOST_LOCALE_HIDE_AUTO_PTR
#define BOOST_BIND_NO_PLACEHOLDERS
#pragma push_macro("slots")
#undef slots
#include <boost/python/numpy.hpp>
#include <boost/python.hpp>
#pragma pop_macro("slots")

void n_gram_calc(const std::string& doc, int n);

std::vector<int> freq_in_chunk(const std::string& chunk,
    const std::vector<std::string>& dictonary);

long double dzv_calc(int T, const std::vector<int> di,
    const std::vector <int> dj, int i, int j,
    const std::vector<std::vector<int>> freq_of_robot_ngramm_i,
    const std::vector<std::vector<int>> freq_of_robot_ngramm_j);

long double zv_calc(int T, const std::vector<int> di, int i,
    const std::vector<std::vector<int>> freq_of_robot_ngramm_i_j);

long double spearman_calc(const std::vector<int> di, const std::vector<int> freq_of_robot_ngramm_k);

void prepare(std::string& st);