public static void testWholeDir() throws Exception {

		long stime;
		long ltime;
		stime = System.currentTimeMillis();
		InputStream fstream;
		BufferedReader reader;
		// String fname = "/home/nlp/Documents/bnc/bnc/A/A0/A00";
		String fname;
		GrammarCheckerParser parser;

		//String path = "D:\\netcode\\bnc";
		String path = "/home/nlp/Documents/bnc/bnc";
		File file = new File(path);
		/*
		HashMap<String, String> map = new HashMap<String, String>();

		map.put("the5'-3'-3", "sdfa");

		if (map.get("the5'-3'-3".toLowerCase()) != null)
			System.out.println("haha");
		else
			System.out.println("cry");
        */
		// NgramService service = new NgramService();
		//
		// Ngram result = service.findNgram("the_reality");
		//
		// if (result != null) {
		// System.out.println("the result: " + result.getWordGroup()
		// + result.getWordAttribute() + result.getFrequence());
		// }

		int count = 0;
		if (file.isDirectory()) {
			File[] subDir = file.listFiles();

			for (int i = 0; i < subDir.length; i++) {
				if (subDir[i].isDirectory()) {
					System.out.println("this is dir:" + subDir[i].getName());

					File ssubArr[] = subDir[i].listFiles();

					for (int j = 0; j < ssubArr.length; j++) {
						if (ssubArr[j].isDirectory()) {
							System.out.println("this is dir: "
									+ ssubArr[j].getName());

							File fileArr[] = ssubArr[j].listFiles();

							for (int k = 0; k < fileArr.length; k++) {
								if (fileArr[k].isFile()) {
									System.out.println("this is file: "
											+ ssubArr[j].toString() + "/"
											+ fileArr[k].getName());
									fname = ssubArr[j].toString() + "/"
											+ fileArr[k].getName();

									try {
										fstream = new BufferedInputStream(
												new FileInputStream(fname));
										reader = new BufferedReader(
												new FileReader(fname));
										parser = new GrammarCheckerParser(
												fname, reader);
										parser.parserSevenGram();
										fstream.close();
									} catch (FileNotFoundException e) {
										// TODO Auto-generated catch block
										e.printStackTrace();
									}
								}
							}
						}
					}

				}
			}

		}
		System.out.println(count);
	}