private static void writeResult(String path, String fileName,
			Classifier<String, String> bayes) {
		
		FileWriter writer = null;
		try {

			// 打开一个写文件器，构造函数中的第二个参数true表示以追加形式写文件
			writer = new FileWriter(path + fileName);
			
			Dictionary<String, Integer> cateDic = bayes.getTotalCategoryCount();
			JSONObject cateJson = dicToJson(cateDic);
			Dictionary<String, Integer> featDic = bayes.getTotalFeatureCount();
			JSONObject featJson = dicToJson(featDic);
			Dictionary<String, Dictionary<String, Integer>> featPerDic = bayes.getFeatureCountPerCategory();
			JSONObject featPerJson = dicDicToJson(featPerDic);
			
			writer.write("ca\t");
			writer.write(cateJson.toString());
			writer.write("\n");
			writer.write("fe\t");
			writer.write(featJson.toString());
			writer.write("\n");
			writer.write("per\t");
			writer.write(featPerJson.toString());
			writer.write("\n");

			writer.close();
		} catch (IOException e) {
			e.printStackTrace();
		} finally {
			if (writer != null) {
				try {
					writer.close();
				} catch (IOException e1) {
					e1.printStackTrace();
				}
			}
		}
	}