public static HashMap<String, String> backward(String folder,Page page) {
		try {

			String text = page.getRevision().getText();

			char[] txtArray = text.toCharArray();
			int i = 0, j = 0;

			int txlen = txtArray.length;
			Vector<String> links = new Vector<String>();
			for (j = 0; j < txlen - 2; j++) {
				String chk = new String(txtArray, j, 2);
				if (chk.equalsIgnoreCase("[[")) {
					// stack.push("[[");
					for (i = j + 2; i < txlen; i++) {
						if (txtArray[i] == '|' | txtArray[i] == ']') {
							String val = new String(txtArray, j + 2, i - j - 2);
							String split[] = val.split(":");
							if (split.length != 2) {
								//String ind = fetchIndex(val);
								
								String ind=globalhmap.get(val);
								if (ind == null){
									//System.out.println("Pageid:" + page.getId()
									//		+ " Not Found for:" + val);
								}else {
									//System.out.println(val+" found id:" + ind);
									links.add(ind);
								}
							}
							j = i + 1;
							break;
						}
					}
				}
			}

			File file = new File(folder+"/forward");
			FileWriter fw = new FileWriter(file, true);
			BufferedWriter bw = new BufferedWriter(fw);

			bw.write(page.getId() + ":"+links.size());
			bw.newLine();
			bw.close();
			fw.close();
			HashMap<String, String> hmap = new HashMap<String, String>();
			// System.out.println(page.getId());
			// System.out.println(links);
			for (String s : links) {
				String tok[]=s.split(",");
				for(String str:tok){
					hmap.put(str, page.getId().toString());
					//System.out.println(str+"---"+page.getId().toString());
				}
			}
			
			
			return hmap;
		} catch (Exception e) {
			e.printStackTrace();
		}
		return null;

	}