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

熱點內容
網盤源碼系統商業 瀏覽:466
php網路工程師崗位職責 瀏覽:998
土豆伺服器風險怎麼樣 瀏覽:990
win11怎麼安裝安卓游戲 瀏覽:555
程序員報考內容 瀏覽:302
su3維文本命令 瀏覽:871
單片機存儲器類型 瀏覽:13
unix查看埠命令 瀏覽:21
程序員團建活動有哪些 瀏覽:67
libzip壓縮解壓 瀏覽:943
廣州銀行app如何導流水 瀏覽:385
什麼是寫命令 瀏覽:687
程序員眼中的道德 瀏覽:506
文件解壓後亂碼是什麼原因 瀏覽:730
php路徑轉換 瀏覽:188
php中flag 瀏覽:183
當程序員要做什麼准備 瀏覽:284
pinctrllinux 瀏覽:901
lzw壓縮工具 瀏覽:864
luae加密插件破解版 瀏覽:141