public void computeTFMultiIDF(String strDir, double trainSamplePercent, int indexOfSample, Map<String, Double> iDFPerWordMap, Map<String, Double> wordMap) throws IOException{
		File fileDir = new File(strDir);
		String word;
		SortedMap<String,Double> TFPerDocMap = new TreeMap<String,Double>();
		//עдļһרдһרдѵsampleTypeֵʾ
		String trainFileDir = "F:/DataMiningSample/docVector/wordTFIDFMapTrainSample"+indexOfSample;
		String testFileDir = "F:/DataMiningSample/docVector/wordTFIDFMapTestSample"+indexOfSample;
		FileWriter tsTrainWriter = new FileWriter(new File(trainFileDir));
		FileWriter tsTestWrtier = new FileWriter(new File(testFileDir));
		FileWriter tsWriter = tsTrainWriter;
		File[] sampleDir = fileDir.listFiles();
		for(int i = 0; i < sampleDir.length; i++){
			String cateShortName = sampleDir[i].getName();
			System.out.println("compute: " + cateShortName);
			File[] sample = sampleDir[i].listFiles();
			double testBeginIndex = indexOfSample*(sample.length * (1-trainSamplePercent));//ʼļ
			double testEndIndex = (indexOfSample+1)*(sample.length * (1-trainSamplePercent));//Ľļ
			System.out.println("dirName_total length:"+sampleDir[i].getCanonicalPath()+"_"+sample.length);
			System.out.println(trainSamplePercent + " length:"+sample.length * trainSamplePercent +" testBeginIndex:"+testBeginIndex+" testEndIndex"+ testEndIndex);	
			for(int j = 0;j < sample.length; j++){
				TFPerDocMap.clear();
				FileReader samReader = new FileReader(sample[j]);
				BufferedReader samBR = new BufferedReader(samReader);
				String fileShortName = sample[j].getName();
				Double wordSumPerDoc = 0.0;//ÿƪĵܴ
				while((word = samBR.readLine()) != null){
					if(!word.isEmpty() && wordMap.containsKey(word)){//ԴʵĴʣȥĴʲ
						wordSumPerDoc++;
						if(TFPerDocMap.containsKey(word)){
							Double count =  TFPerDocMap.get(word);
							TFPerDocMap.put(word, count + 1);
						}
						else {
							TFPerDocMap.put(word, 1.0);
						}
					}
				}
				//һµǰĵTFmapĵܴɴƵ,Ȼ󽫴ƵԴʵIDFõյȨֵļ
				//עѵдļͬ
				if(j >= testBeginIndex && j <= testEndIndex){
					tsWriter = tsTestWrtier;
				}
				else{
					tsWriter = tsTrainWriter;
				}
				Double wordWeight;
				Set<Map.Entry<String, Double>> tempTF = TFPerDocMap.entrySet();
				for(Iterator<Map.Entry<String, Double>> mt = tempTF.iterator(); mt.hasNext();){
					Map.Entry<String, Double> me = mt.next();
					//wordWeight =  (me.getValue() / wordSumPerDoc) * IDFPerWordMap.get(me.getKey());
					//ڼIDFǳʱ3ʵԴʵҪ25СʱȳΪдʵIDF1
					wordWeight =  (me.getValue() / wordSumPerDoc) * 1.0;
					TFPerDocMap.put(me.getKey(), wordWeight);
				}
				tsWriter.append(cateShortName + " ");
				String keyWord = fileShortName.substring(0,5);
				tsWriter.append(keyWord+ " ");
				Set<Map.Entry<String, Double>> tempTF2 = TFPerDocMap.entrySet();
				for(Iterator<Map.Entry<String, Double>> mt = tempTF2.iterator(); mt.hasNext();){
					Map.Entry<String, Double> ne = mt.next();
					tsWriter.append(ne.getKey() + " " + ne.getValue() + " ");
				}
				tsWriter.append("\n");	
				tsWriter.flush();
			}
		}
		tsTrainWriter.close();
		tsTestWrtier.close();
		tsWriter.close();
	}