Browse Source

Merge branch 'translation' of http://gitz.zhixinhuixue.net:18880/zxhx-client-tool/pdfproject into translation

maoyehu 2 years ago
parent
commit
d4f81110f2
2 changed files with 12 additions and 2 deletions
  1. 11 1
      MFCApplication1/AssignWords.cpp
  2. 1 1
      MFCApplication1/AssignWords.h

+ 11 - 1
MFCApplication1/AssignWords.cpp

@@ -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,
-	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);
 	TCHAR pFileName[MAX_PATH + 2] = { 0 };
@@ -238,6 +239,7 @@ int AssignWordsFromTest(std::string pathName, std::vector<tuple< string, string>
 			{
 				return -2;
 			}
+			
 			std::string strTemp = line,strTempAnother = lineOther;
 			UTF8toANSI(strTemp);
 			UTF8toANSI(strTempAnother);
@@ -245,10 +247,12 @@ int AssignWordsFromTest(std::string pathName, std::vector<tuple< string, string>
 				continue;
 			else if (strTemp == "")
 			{
+				ret = nHangCount;
 				return -3;
 			}
 			else if (strTempAnother == "")
 			{
+				ret = nHangCount;
 				return -4;
 			}
 			
@@ -270,6 +274,12 @@ int AssignWordsFromTest(std::string pathName, std::vector<tuple< string, string>
 			}
 			memset(line, 0, 4096);
 			memset(lineOther, 0, 4096);
+			nHangCount++;
+		}
+		// 源文件结束,查看答案文件是否结束
+		if (finOther.getline(lineOther, sizeof(lineOther)))
+		{
+			return -2;
 		}
 		
 	}

+ 1 - 1
MFCApplication1/AssignWords.h

@@ -19,4 +19,4 @@ using namespace std;
 //         -4:内容行空,原数据行有数据
 /***********************************************************************/
 int AssignWordsFromTest(std::string pathName, std::vector<tuple< string, string>> &oneList, std::vector<tuple< string, string>> &twoList,
-	std::vector<tuple< string, string>> &errorList, std::vector<tuple< string, string>> &fourList);
+	std::vector<tuple< string, string>> &errorList, std::vector<tuple< string, string>> &fourList,int &ret);