|
@@ -187,8 +187,9 @@ void AssignWordsFromString(std::string strContent, int maxTwoWith, int maxTreeWi
|
|
|
|
|
|
|
|
|
|
int AssignWordsFromTest(std::string pathName, std::vector<tuple< string, string>> &oneList, std::vector<tuple< string, string>> &twoList,
|
|
int AssignWordsFromTest(std::string pathName, std::vector<tuple< string, string>> &oneList, std::vector<tuple< string, string>> &twoList,
|
|
- std::vector<tuple< string, string>> &threeList, std::vector<tuple< string, string>> &fourList)
|
|
|
|
|
|
+ std::vector<tuple< string, string>> &threeList, std::vector<tuple< string, string>> &fourList, int &ret)
|
|
{
|
|
{
|
|
|
|
+ int nHangCount = 1;
|
|
// 词性处理
|
|
// 词性处理
|
|
HMODULE module = GetModuleHandle(0);
|
|
HMODULE module = GetModuleHandle(0);
|
|
TCHAR pFileName[MAX_PATH + 2] = { 0 };
|
|
TCHAR pFileName[MAX_PATH + 2] = { 0 };
|
|
@@ -238,6 +239,7 @@ int AssignWordsFromTest(std::string pathName, std::vector<tuple< string, string>
|
|
{
|
|
{
|
|
return -2;
|
|
return -2;
|
|
}
|
|
}
|
|
|
|
+
|
|
std::string strTemp = line,strTempAnother = lineOther;
|
|
std::string strTemp = line,strTempAnother = lineOther;
|
|
UTF8toANSI(strTemp);
|
|
UTF8toANSI(strTemp);
|
|
UTF8toANSI(strTempAnother);
|
|
UTF8toANSI(strTempAnother);
|
|
@@ -245,10 +247,12 @@ int AssignWordsFromTest(std::string pathName, std::vector<tuple< string, string>
|
|
continue;
|
|
continue;
|
|
else if (strTemp == "")
|
|
else if (strTemp == "")
|
|
{
|
|
{
|
|
|
|
+ ret = nHangCount;
|
|
return -3;
|
|
return -3;
|
|
}
|
|
}
|
|
else if (strTempAnother == "")
|
|
else if (strTempAnother == "")
|
|
{
|
|
{
|
|
|
|
+ ret = nHangCount;
|
|
return -4;
|
|
return -4;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -270,6 +274,12 @@ int AssignWordsFromTest(std::string pathName, std::vector<tuple< string, string>
|
|
}
|
|
}
|
|
memset(line, 0, 4096);
|
|
memset(line, 0, 4096);
|
|
memset(lineOther, 0, 4096);
|
|
memset(lineOther, 0, 4096);
|
|
|
|
+ nHangCount++;
|
|
|
|
+ }
|
|
|
|
+ // 源文件结束,查看答案文件是否结束
|
|
|
|
+ if (finOther.getline(lineOther, sizeof(lineOther)))
|
|
|
|
+ {
|
|
|
|
+ return -2;
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|