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

熱點內容
黑馬程序員路徑大全 瀏覽:1000
saas平台PHP 瀏覽:333
雲伺服器科學計算配置怎麼選 瀏覽:649
jar解壓命令 瀏覽:609
php正則問號 瀏覽:299
無線已加密不可上網是怎麼了 瀏覽:464
什麼app可以免費做手機 瀏覽:375
異性下載什麼app 瀏覽:680
51單片機程序單步視頻 瀏覽:241
家庭寬頻如何連接伺服器 瀏覽:119
汽車高壓泵解壓 瀏覽:772
上門正骨用什麼app 瀏覽:761
安卓為什麼免費使用 瀏覽:397
加密貨幣都有哪些平台 瀏覽:628
python和matlab難度 瀏覽:391
python爬蟲很難學么 瀏覽:574
小米解壓積木可以組成什麼呢 瀏覽:816
為什麼滴滴出行app還能用 瀏覽:566
怎麼升級手機android 瀏覽:926
php權威編程pdf 瀏覽:998