導航:首頁 > 源碼編譯 > 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通信測試軟體源碼相關的資料

熱點內容
抖音上的程序員和真正的程序員 瀏覽:300
查看kernel編譯器 瀏覽:279
給plc程序加密 瀏覽:225
python多進程數據共享 瀏覽:847
華為和安卓系統有什麼不一樣 瀏覽:106
python中wb表怎麼列印 瀏覽:297
python如何把字元串賦給數組 瀏覽:229
狄克斯特拉演算法是什麼 瀏覽:675
室內裝飾材料pdf 瀏覽:633
gitbook命令行 瀏覽:1000
啟動zookeeper命令 瀏覽:527
健身館app怎麼樣 瀏覽:314
python可視化項目 瀏覽:442
安卓機怎麼辨別蘋果機真假 瀏覽:711
微信小程序源碼轉成抖音 瀏覽:654
優省油app怎麼沒法下載 瀏覽:72
pdf格式轉換excel 瀏覽:625
高爾夫6壓縮機響 瀏覽:310
優盤文件夾自動恢復 瀏覽:76
有伺服器怎麼製作小程序 瀏覽:132