public static void invertedIndexWriter(int fileNum){
		System.out.println("start write inverted index into file");
		//start print Inverted index to file
		
		Iterator  ilter1= index.postingMap.entrySet().iterator();
		BufferedWriter fout;
		try {
			fout = new BufferedWriter(new FileWriter("result/inverted_index_"+fileNum+".txt"));
			while (ilter1.hasNext())
			{
				 Map.Entry entry1 = (Map.Entry) ilter1.next();
				 String word = (String) entry1.getKey();
				 TreeMap posting = (TreeMap) entry1.getValue();
				 
				 Iterator  ilter2= posting.entrySet().iterator();
				 String post_string = word+" ";
				 while (ilter2.hasNext())  // concatenate all docID and freq for this word;
				 {
					 Map.Entry entry2 = (Map.Entry) ilter2.next();
					 int docID = (int)entry2.getKey();
					 int freq = (int)entry2.getValue();
					 post_string += docID+" "+freq+" ";
				 }
				 fout.write(post_string+"\n");
			 }
			fout.flush();
			fout.close();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}//end print Inverted index into file inverted_index_i.txt(i from 0 to 82)
		System.out.println("end write inverted index into file");
   }//end for documents