導航:首頁 > 源碼編譯 > tf通信測試軟體源碼

tf通信測試軟體源碼

發布時間:2023-08-04 14:59:50

A. 安卓手機如何測試手機tf卡讀寫速度

TF卡上有速度等級標志(字母C內有一個數字),一般手機用C4(Class4)就可以了。C6以上的在手機和平板電腦上體現不出來。

B. C++通訊錄的源代碼

分是萬能的嗎?
請客氣些。

C. 求TF-IDF演算法的C++或java源碼

之前寫過的,請加分。

#include<map>
#include<set>
#include<string>
#include<iostream>
#include<fstream>
#include<vector>
#include<cmath>
#include<algorithm>
usingnamespacestd;
map<string,float>IDFTable;
structWords{
stringwd;
floatfreq;
floatweight;
};
boolcmp(Words&w1,Words&w2)
{
returnw1.weight>w2.weight;
}
map<string,int>WordTable;
vector<Words>WordList;
charComment[]=",.!"?;:()";
inttotalText=0;
boolIsAllNumber(stringcs)
{
for(inti=0;i<cs.length();i++)
{
if(cs[i]<'0'||cs[i]>'9')
returnfalse;
}
returntrue;
}
boolIsblank(stringcs)
{
for(inti=0;i<cs.length();i++)
{
if(cs[i]!=''&&cs[i]!=' ')
returnfalse;
}
returntrue;
}
string&ToLower(string&cs)
{
for(inti=0;i<cs.length();i++)
{
if(cs[i]>='A'&&cs[i]<='Z')
cs[i]+=('a'-'A');
}
returncs;
}
voidreadFile(stringfname,set<string>&wds)
{
ifstreamfin(fname.c_str());
stringword;
wds.clear();
while(!fin.eof())
{
fin>>word;
for(inti=0;Comment[i]!=0;i++)
{
intpos;
while((pos=word.find(Comment[i]))!=-1)
{
word.replace(pos,1,"");
}
}
//theworld;
if(!IsAllNumber(word)&&!Isblank(word))
{
wds.insert(ToLower(word));
}
/*totalwords++;
*/
}
fin.close();
}
voidGenerateIDF()
{
totalText=0;
stringfiles[7]={"curious.txt",
"erotic.txt",
"fall.txt",
"hands.txt",
"water.txt",
"wifi.txt",
"young.txt"};
intx;
set<string>wds;
for(inti=0;i<7;i++)
{
readFile(files[i],wds);
for(set<string>::iteratorit=wds.begin();it!=wds.end();++it)
{
map<string,float>::iteratoriter;
stringword=*it;
if((iter=IDFTable.find(word))!=IDFTable.end())
{
iter->second+=1;
}
else
{
IDFTable[word]=1;
}
}
totalText++;
}
//
intcnt=0;
for(map<string,float>::iteratoriter=IDFTable.begin();iter!=IDFTable.end();++iter)
{
iter->second=log((float)totalText/(iter->second+1.0));
/*cout<<iter->first<<''<<iter->second<<endl;
cnt++;
if(cnt%100==0)
{
cin>>x;
}*/
}
}
intGenerateTF(){
ifstreamfin("Test.txt");
stringword;
inttextwords=0;
while(!fin.eof())
{
fin>>word;
for(inti=0;Comment[i]!=0;i++)
{
intpos;
while((pos=word.find(Comment[i]))!=-1)
{
word.replace(pos,1,"");
}
}
if(!IsAllNumber(word)&&!Isblank(word))
{
//wds.insert(ToLower(word));
textwords++;
ToLower(word);
map<string,int>::iteratorit;
if((it=WordTable.find(word))!=WordTable.end())
{
it->second++;
}
else
{
WordTable[word]=1;
}

}


}
fin.close();
//計算頻率
for(map<string,int>::iteratorit=WordTable.begin();it!=WordTable.end();++it)
{
Wordswd;
wd.wd=it->first;
wd.freq=(float)(it->second)/textwords;
floatidf=0;
map<string,float>::iteratoriter;
if((iter=IDFTable.find(wd.wd))!=IDFTable.end())
{
idf=iter->second;
}
else
idf=log((float)totalText);
wd.weight=wd.freq*idf;
WordList.push_back(wd);
}

returntextwords;
}
voidGenerateSort()
{
sort(WordList.begin(),WordList.end(),cmp);
}
intmain(){
GenerateIDF();
inttxtwd=GenerateTF();
GenerateSort();
inttopnum=10;
cout<<"TotalWords:"<<txtwd<<"Top"<<topnum<<": ";
cout<<"Wrod Weight ";
for(inti=0;i<topnum;i++)
{
cout<<WordList[i].wd<<" "<<WordList[i].weight<<endl;
}
}
閱讀全文

與tf通信測試軟體源碼相關的資料

熱點內容
戰地怎麼看伺服器地址 瀏覽:348
vue怎麼打包放上伺服器 瀏覽:165
為什麼安卓服夏日活動沒有兔子頭 瀏覽:894
pubg為什麼顯示伺服器連接失敗 瀏覽:650
阿里雲掃碼登錄伺服器 瀏覽:970
化學基礎pdf 瀏覽:896
51單片機晶碼管 瀏覽:281
怎麼查伺服器假死原因日誌在哪看 瀏覽:277
掃描pdf文件 瀏覽:926
解壓密碼百度雲在線解壓 瀏覽:767
傳播學演算法推薦 瀏覽:749
我的世界網路游戲如何查找伺服器 瀏覽:257
安卓和蘋果通訊錄怎麼互傳 瀏覽:203
怎麼打開隱私與應用加密的菜單 瀏覽:416
我的世界伺服器小游戲的地址大全 瀏覽:578
在網路安全中加密安全機制提供了數據的 瀏覽:249
南京前端程序員私活怎麼收費 瀏覽:981
拓撲pdf 瀏覽:440
如何在工行app查我的訂單 瀏覽:214
車壓縮機改電動 瀏覽:83