public static void main(String args[]){
		String objectListPath = "/u/ml/mindseye/nlg_lm/LM/lesk_syns_purdue.txt";
		int no_objects = readObjectList(objectListPath);
		String outputMatrixPath = "/u/ml/mindseye/nlg_lm/LM/object_count.txt";
		
		int[] object_counts = new int[no_objects];
		String ldcCorpusPath = "/scratch/cluster/niveda/extracted_original";
		File input_folder = new File(ldcCorpusPath);
		Stack<File> stack = new Stack<File>();
		stack.push(input_folder);
		int x=1;
		try{
		while (!stack.isEmpty()) {
			File child = stack.pop();
			if (child.isDirectory()) {
				for (File f : child.listFiles())
					stack.push(f);
			} else if (child.isFile()) {

				System.out
						.println("Processing: " + child.getAbsolutePath());
				FileReader fr = new FileReader(child.getAbsolutePath());
				BufferedReader br = new BufferedReader(fr);
				String readLine = "";
				
				while ((readLine = br.readLine()) != null) {
				
					String words[] = readLine.split("\\s+");
					for(int i=0;i<words.length;i++){
						if(object_words.containsKey(words[i]))
							object_counts[object_words.get(words[i])]+=1;
					}
				}
				br.close();
				fr.close();
			}

		}
		FileWriter fw = new FileWriter(outputMatrixPath);
		fw.write("[OBJECT_COUNTS]\n");
		for (int i = 0; i < no_objects; i++) {
			fw.write(object_counts[i]+"\t");
		}
		fw.close();
		}
		catch(Exception e){
			System.out.println("Exception caught:"+e);
			e.printStackTrace();
		}
	}