DictionariesRepository.hpp
1.04 KB
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
/*
* File: DictionariesRepository.hpp
* Author: lennyn
*
* Created on August 8, 2014, 3:49 PM
*/
#ifndef DICTIONARIESREPOSITORY_HPP
#define DICTIONARIESREPOSITORY_HPP
#include "morfeusz2.h"
#include "Dictionary.hpp"
#include "const.hpp"
#include <map>
#include <string>
namespace morfeusz {
class DictionariesRepository {
public:
const Dictionary* getDictionary(const std::string& name, MorfeuszProcessorType processorType);
private:
bool hasLoadedDictionary(const std::string& name, MorfeuszProcessorType processorType) const;
std::string getPathToDictionary(const std::string& name, MorfeuszProcessorType processorType) const;
const Dictionary* doLoadDictionary(const std::string& name, MorfeuszProcessorType processorType) const;
struct RepositoryEntry {
Dictionary* analyzerDictionary;
Dictionary* generatorDictionary;
};
std::map<std::string, RepositoryEntry> entriesMap;
};
}
#endif /* DICTIONARIESREPOSITORY_HPP */