public void AddLabels4Regular(int num_of_topics,double[] threshold,boolean entire){
		BufferedReader br = null;
		BufferedWriter bw = null;
		String inFile = this.homeFolder + "/"+ R_DISTRIBUTE_TOPIC_FILE_NAME;
		String outFile = this.homeFolder + "/" + R_BUG_TOPIC_FILE_NAME;	
		this.cases = threshold;
		
		try{
			if(!new File(inFile).exists()){
				throw new Exception("There is no topic file");
			}			
			
			br = new BufferedReader(new FileReader(inFile));
			bw = new BufferedWriter(new FileWriter(outFile));
			String line = br.readLine();
			while(line != null){
				String[] metrics = line.split(",");
				String bugId = metrics[0];
				bw.write(bugId+",");
				ArrayList<String> labels_list = this.caculateLabel4Regular(metrics,num_of_topics,threshold);				
				for(int l=0;l<labels_list.size();l++){
					bw.write(labels_list.get(l)+",");	
				}				
				if(entire){
					bw.write(line.substring(line.indexOf(','),line.length()));	
				}
				bw.write("\n");				
				bw.flush();
				line = br.readLine();
			}
						
		System.out.println("please check output file: "+outFile);			
		}catch(Exception e){
			e.printStackTrace();
		}finally{
			try{
				if(br!=null)
					br.close();
				if(bw != null)
					bw.close();
			}catch(Exception e){
				e.printStackTrace();
			}
		}		
	}