get rid of codecvt
This commit is contained in:
parent
7a938a65c8
commit
fe01bcc3db
@ -2,6 +2,8 @@
|
||||
|
||||
#include <iostream> //Xperimental -- for debug only
|
||||
|
||||
#include "utf8utf16.h"
|
||||
|
||||
|
||||
std::wstring NounDeclencionToWString(NounDeclencion nounDeclencion)
|
||||
{
|
||||
@ -375,17 +377,19 @@ std::vector<NounStruct> RecognizeNoun(std::wstring noun)
|
||||
|
||||
void LoadFrequentWordSet()
|
||||
{
|
||||
std::wifstream f("C:/Workplace/ChineseJournal/rudict/frequent_words.txt");
|
||||
std::ifstream f("C:/Workplace/ChineseJournal/rudict/frequent_words.txt");
|
||||
|
||||
f.imbue(std::locale(std::locale::empty(), new std::codecvt_utf8<wchar_t>));
|
||||
//f.imbue(std::locale(std::locale::empty(), new std::codecvt_utf8<wchar_t>));
|
||||
|
||||
std::wstring line;
|
||||
std::string line;
|
||||
std::wstring wline;
|
||||
|
||||
if (f.is_open())
|
||||
{
|
||||
while (getline(f, line))
|
||||
{
|
||||
frequentWordSet.insert(line);
|
||||
wline = UTF8to16(line.c_str());
|
||||
frequentWordSet.insert(wline);
|
||||
}
|
||||
f.close();
|
||||
}
|
||||
|
@ -6,7 +6,6 @@
|
||||
#include <set>
|
||||
#include <vector>
|
||||
#include <fstream>
|
||||
#include <codecvt>
|
||||
|
||||
#include "boost/algorithm/string.hpp"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user