My excersize program used to extract English words from a library
来源:互联网 发布:中关村网盘数据 编辑:程序博客网 时间:2024/05/16 09:57
void CReadDictionaryDlg::OnRead()
{
// TODO: Add your control notification handler code here
char chRead[1] = {0};
CFile flRead;]
// BOOL bOpen = flRead.Open("CK-N4.PMS",CFile::modeRead|CFile::typeBinary);
BOOL bOpen = flRead.Open("CK-TL.PMS",CFile::modeRead|CFile::typeBinary);
//There are three colum for a English word:Word alphabet, Phenonen, Chinese Notation
BOOL bFirstWord = FALSE, bSecondWord = FALSE, bThirdWord = FALSE;
//Encount a space first time
BOOL bFirstEncounterSpace = FALSE;
std::string strWord[3];
int iWordEncounter = 0;
int nGroup25 = 0;
if(bOpen)
{
flRead.Seek(0xbc1,CFile::begin);
const int nLength = flRead.GetLength() - 0xbc2 -0x67B;
int nPos = 0;
flRead.Read((void*)chRead,1);
bFirstWord = !bFirstWord;
while( nPos != nLength)
{
flRead.Read((void*)chRead,1);
if(chRead[0] == 0x20)
{
if(!bFirstEncounterSpace)
{
bFirstEncounterSpace = TRUE;
iWordEncounter ++;
nGroup25 ++;
if(iWordEncounter%3 != 2)
{
char chTemp[80];
strcpy(chTemp,strWord[iWordEncounter-1].c_str());
m_strDisplayWord += strWord[iWordEncounter-1].c_str();
m_strDisplayWord += "/r/n";
}
}
}
else
{
if(bFirstEncounterSpace)
{
if(!(nGroup25%75))
{
static int nTemp = 1;
nTemp ++;
bFirstEncounterSpace = FALSE;
flRead.Seek(79, CFile::current);
nPos += 80;
strWord[iWordEncounter] = "";
}
else
{
bFirstEncounterSpace = FALSE;
iWordEncounter = (iWordEncounter)%3;
strWord[iWordEncounter] = "";
strWord[iWordEncounter] += chRead[0];
}
}
else
{
strWord[iWordEncounter] += chRead[0];
}
}
nPos ++;
}
flRead.Close();
}
UpdateData(FALSE);
}
- My excersize program used to extract English words from a library
- decruft(A library to extract meaningful data from a webpage) 源码分析
- How to extract .obj from a .lib
- Integer to English Words
- Integer to English Words
- Integer to English Words
- Integer to English Words
- LeetCode273Integer to English Words
- Integer to English Words
- Integer to English Words
- Integer to English Words
- Integer to English Words
- Integer to English Words
- Integer to English Words
- Integer to English Words
- Integer to English Words
- Integer to English Words
- Integer to English Words
- 在Repeater控件中使用模版形成交叉颜色的表格。
- Introducing the 4+1 view model
- asp取首字拼音代码
- cms 开源项目
- iframe的新发现
- My excersize program used to extract English words from a library
- 线程同步
- 静态数据的初始化
- REALbasic图书资料一览
- 技术如繁星点点,浩瀚无穷
- thinking in c++读书笔记---------继承与组合
- 九大技巧,提升XP运行速度100%
- 自动滚动换行
- 装机清单