Just testing a bit
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
#ifndef FILEUTILS_H
|
||||
#define FILEUTILS_H
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
using namespace std;
|
||||
|
||||
struct FileUtils {
|
||||
static bool fileExists(const char *path);
|
||||
static char* getFiles(const char *path);
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,23 @@
|
||||
#ifndef SERVERUTILS_H
|
||||
#define SERVERUTILS_H
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <unistd.h>
|
||||
#include <netinet/in.h>
|
||||
#include <thread>
|
||||
#include <chrono>
|
||||
#include <unordered_map>
|
||||
#include <map>
|
||||
|
||||
using namespace std;
|
||||
|
||||
struct ServerUtils {
|
||||
static void serve(map<string, map<string, int>> wordwordFrequencies);
|
||||
static void process_request(int client_fd, map<string, map<string, int>> wordwordFrequencies);
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,20 @@
|
||||
#ifndef WORDUTILS_H
|
||||
#define WORDUTILS_H
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <unordered_map>
|
||||
#include <map>
|
||||
#include <iostream>
|
||||
|
||||
using namespace std;
|
||||
|
||||
struct WordUtils {
|
||||
static map<string, map<string, int>> load_data(const char *path);
|
||||
static vector<string> predictNextWord(const string& input, const map<string, map<string, int>>& model, size_t count);
|
||||
static string load_file(const char *path);
|
||||
static vector<string> split_string(const string& input, const char *delimiters);
|
||||
static string extract_url(const string& input);
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user