@SuppressWarnings("unchecked")
	public void setBackgroundCorpus(String rootdir, int suffix) {
		CorpusLoaderVisitor visitor = new CorpusLoaderVisitor();
		// TODO Auto-generated method stub
		HashMap<String, Object> model = new HashMap<String, Object> ();
		backgroundModel = new HashMap<String, Double> ();
		File background = new File("background.corpus" + suffix);
		
		
		if(background.exists()) {
			try {
				FileInputStream in = new FileInputStream(background);
				BufferedInputStream inStream = new BufferedInputStream(in);
				ObjectInputStream objectInStream = new ObjectInputStream(inStream);
				model = (HashMap<String, Object>) objectInStream.readObject();
				objectInStream.close();
				inStream.close();
				in.close();
			} catch (IOException | ClassNotFoundException e ) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			//return model;
		} else {

			Path startingDir = FileSystems.getDefault().getPath(rootdir);
			try {
				long start = System.currentTimeMillis();
				Files.walkFileTree(startingDir, visitor);
				long end = System.currentTimeMillis();
				System.out.println(end - start);
			} catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			
			model.put("scores", visitor.counter.toHashMap());
			model.put("Total", new Integer(visitor.totalComments));
			try {
				FileOutputStream out = new FileOutputStream(background);
				BufferedOutputStream outStream = new BufferedOutputStream(out);
				ObjectOutputStream objectOutStream = new ObjectOutputStream(outStream);
				objectOutStream.writeObject(model);
				objectOutStream.close();
				outStream.close();
				out.close();
			} catch (IOException e1) {
				// TODO Auto-generated catch block
				e1.printStackTrace();
			}
		}
		HashMap<String, Integer> scores = (HashMap<String, Integer>)model.get("scores");
		this.backgroundComments = (Integer)model.get("Total");
		for (Map.Entry<String, Integer> e :  scores.entrySet()) {
			backgroundModel.put(e.getKey(), ((double) e.getValue()) / this.backgroundComments );
		}
	}