团队第二阶段个人冲刺day08
今天实现了待排序文本和数据库文本数据的匹配
public String classify(String text)
{
String[] terms = null;
terms= ChineseSpliter.split(text, " ").split(" ");//中文分词处理(分词后结果可能还包含有停用词)
terms = DropStopWords(terms);//去掉停用词,以免影响匹配
String[] Classes = tdm.getTraningClassifications();
float probility = 0.0F;
List<ClassifyResult> crs = new ArrayList<ClassifyResult>();//匹配结果
for (int i = 0; i <Classes.length; i++)
{
String Ci = Classes[i];
probility = calcProd(terms, Ci);
//保存匹配结果
ClassifyResult cr = new ClassifyResult();
cr.classification = Ci;//匹配
cr.probility = probility;//匹配度
System.out.println("In process....");
System.out.println(Ci + ":" + probility);
crs.add(cr);
}