-
Notifications
You must be signed in to change notification settings - Fork 0
/
textmanipulator.h
42 lines (34 loc) · 1.22 KB
/
textmanipulator.h
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
40
41
//
// Created by willi on 4/5/2020.
//
#ifndef C___PRACTICE_TEXTMANIPULATOR_H
#define C___PRACTICE_TEXTMANIPULATOR_H
#include <string>
#include <regex>
#include <vector>
#include <algorithm>
#include <map>
class TextManipulator{
private:
std::string fileName;
void sort(std::map<std::string, int>& MapType,std::vector<std::pair<std::string,int>>& vec);
void sortWithoutCopyingFromMap(std::vector<std::pair<std::string,int>>& vec);
void displayAll(std::map<std::string, int>& map,std::vector<std::pair<std::string,int>>& vec,int exportCode);
void displaySpecific(std::map<std::string, int>& map);
bool canBeOpened();//validator functions
void ask();//ask user prompts
public:
//constructors
TextManipulator();
//acessing functions
std::vector<std::string> readAFile();
std::string getFileName();
//working functions
bool setFileName(std::string fileName);
void writeOnFile(std::vector<std::pair<std::string,int>>& vec,std::string fileName);
void calcFrequenciesOfWords(std::vector<std::string> readData,int index);
std::vector<std::string> cancelDelims(std::string word, std::regex reg);
//Destructor
~TextManipulator();
};
#endif //C___PRACTICE_TEXTMANIPULATOR_H