- 博客(0)
- 资源 (5)
- 问答 (1)
- 收藏
- 关注
robotiumsolo
robotium-solo-5.3.1
robotium-solo-5.3.1-javadoc 帮助文档
ExampleTestProject_Eclipse
ExampleTestProject_v5.2.1
2017-11-29
ASP.NET NIIT考试复习资料
新建一个用户控件,以下陈述正确的是:
必须在第一行包含<%@Control %>指令。
必须在页面中包含<%@Control %>指令,出现在第几行没关系。
必须在第一行包含<%@ Register %>指令。
用户控件后缀名必须为 .ascx
必须在页面中包含<%@Page %>指令
A,D
C,D
B,D
A,E
3
2014-04-04
C#中文分词 .NET直接引用版
直接把NICTCASA.DLL 添加引用 把DATA文件放入bin Debug Data目录即可
namespace Test1
{
public partial class Form1 : Form
{
NICTCLAS nictclas;
public Form1()
{
InitializeComponent();
try
{
nictclas = new NICTCLAS();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
private void button1_Click(object sender, EventArgs e)
{
if (radioButton1.Checked)
nictclas.OperateType = eOperateType.OnlySegment;
else if (radioButton2.Checked)
nictclas.OperateType = eOperateType.FirstTag;
else if (radioButton3.Checked)
nictclas.OperateType = eOperateType.SecondTag;
if (radioButton4.Checked)
nictclas.OutputFormat = eOutputFormat.PKU;
else if (radioButton5.Checked)
nictclas.OutputFormat = eOutputFormat._973;
else if (radioButton6.Checked)
nictclas.OutputFormat = eOutputFormat.XML;
DateTime start = DateTime.Now;
string result = "";
nictclas.ParagraphProcessing(textBox1.Text,ref result);
DateTime finish = DateTime.Now;
TimeSpan t = (TimeSpan)(finish - start);
textBox3.Text = t.TotalMilliseconds.ToString() + "ms";
textBox2.Text = result;
}
private void textBox1_TextChanged(object sender, EventArgs e)
{
}
private void textBox2_TextChanged(object sender, EventArgs e)
{
}
}
2014-04-04
TF-IDF C#版
namespace Test.TFIDF
{
class IF_IDF
{
/// <summary>
/// 获取拆分后的词组以及每个词的出现次数
/// </summary>
/// <param name="text"></param>
/// <returns></returns>
public Dictionary<string, int> GetWordsFrequnce(string text)
{
Dictionary<string, int> dictionary = new Dictionary<string, int>();
Regex regex = new Regex(@"[\u4e00-\u9fa5]");//分拣出中文字符
MatchCollection results = regex.Matches(text);
int temp;
foreach (Match word in results)
{
if (dictionary.TryGetValue(word.Value, out temp))
{
temp++;
dictionary.Remove(word.Value);
dictionary.Add(word.Value, temp);
}
else
{
dictionary.Add(word.Value, 1);
}
}
return dictionary;
}
/// <summary>
/// 文档中出现次数最多的词的出现次数
/// </summary>
/// <param name="wordsfre">拆分后的词组字典</param>
/// <returns></returns>
public int MaxWordFrequence( Dictionary<string, int> wordsfre)
{
Dictionary<string, int>.ValueCollection values = wordsfre.Values;
int maxfre = 0;
foreach (int value in values)
{
if (maxfre < value)
{
maxfre = value;
}
}
return maxfre;
}
/// <summary>
/// 计算某词的IF,返回结果
/// </summary>
/// <param name="wordFre"></param>
/// <param name="maxFre"></param>
/// <returns></returns>
2014-04-04
文本相似度计算(TF-IDF)C#
namespace ServiceRanking
{
/// <summary>
/// Summary description for TF_IDFLib.
/// </summary>
public class TFIDFMeasure
{
private string[] _docs;
private string[][] _ngramDoc;
private int _numDocs=0;
private int _numTerms=0;
private ArrayList _terms;
private int[][] _termFreq;
private float[][] _termWeight;
private int[] _maxTermFreq;
private int[] _docFreq;
public class TermVector
{
public static float ComputeCosineSimilarity(float[] vector1, float[] vector2)
{
if (vector1.Length != vector2.Length)
throw new Exception("DIFER LENGTH");
float denom=(VectorLength(vector1) * VectorLength(vector2));
if (denom == 0F)
return 0F;
else
return (InnerProduct(vector1, vector2) / denom);
}
public static float InnerProduct(float[] vector1, float[] vector2)
{
if (vector1.Length != vector2.Length)
throw new Exception("DIFFER LENGTH ARE NOT ALLOWED");
float result=0F;
for (int i=0; i < vector1.Length; i++)
result += vector1[i] * vector2[i];
return result;
}
public static float VectorLength(float[] vector)
{
float sum=0.0F;
for (int i=0; i < vector.Length; i++)
sum=sum + (vector[i] * vector[i]);
return (float)Math.Sqrt(sum);
}
}
private IDictionary _wordsIndex=new Hashtable() ;
public TFIDFMeasure(string[] documents)
{
_docs=documents;
_numDocs=documents.Length ;
MyInit();
}
private void GeneratNgramText()
{
}
private ArrayList GenerateTerms(string[] docs)
{
ArrayList uniques=new ArrayList() ;
_ngramDoc=new string[_numDocs][] ;
for (int i=0; i < docs.Length ; i++)
{
Tokeniser tokenizer=new Tokeniser() ;
string[] words=tokenizer.Partition(docs[i]);
for (int j=0; j < words.Length ; j++)
if (!uniques.Contains(words[j]) )
uniques.Add(words[j]) ;
}
return uniques;
}
private static object
2014-04-04
eclipse Android JUnit Test 时报错
2017-11-29
TA创建的收藏夹 TA关注的收藏夹
TA关注的人