导航:首页 > 源码编译 > 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通信测试软件源码相关的资料

热点内容
linux文件为空 浏览:38
189原版服务器地址 浏览:115
程序员谈国足 浏览:336
本地电脑如何做网站服务器 浏览:484
小寻s5下载的app怎么卸载 浏览:306
zbrushpdf 浏览:897
met肌肉能量技术pdf 浏览:195
php面试重点 浏览:683
如何从管理员界面删除文件夹 浏览:908
单片机三总线信息如何隔离 浏览:690
云服务器研发费用明细 浏览:957
unity3d手机游戏开发pdf 浏览:366
mysql重启命令linux 浏览:876
程序员日常业余内容 浏览:363
steam如何更改吃鸡服务器 浏览:212
我的世界up主多人用什么服务器 浏览:161
缝纫机电脑机编程 浏览:59
autowired源码深度解析 浏览:895
校园卡怎么上app 浏览:743
pascal高精度算法 浏览:870