public void recordCorpusData (Corpus c, Learner l){
		if (!isRecording) return;
		this.c=c;
		Vocabulary v = c.getVocabulary();
		Set<Map.Entry<String, Integer>> entrySet = v.getWordIndicesEntrySet();
		Set<Map.Entry<Integer, Word>> wordSet = v.getWordEntrySet();
		StringBuilder s = new StringBuilder(v.getNumOfWords()*30);
		corpusFile = new File(mainPath, "corpus_"+name+".js");

		s.append(String.format("corpus_%1$s = \n{\n\tname:\"%1$s\",\n", name));
		s.append(String.format("\ttokenCount: %1$s,\n", c.tokenCount));
		s.append(String.format("\ttypeCount: %1$s,\n", v.getNumOfWords()));
		s.append(String.format("\tcommonTypes: %1$s,\n", (v.getNumOfWords()-v.countWordsBelowThreshold(l.RARE_WORD_THRESHOLD))));
		s.append(String.format("\tclusterCount: %1$s,\n", l.NUMBER_OF_CLUSTERS));
		//TODO add proper number formatters
		s.append(String.format("\tidentityEps: %1$s,\n", l.IDENTITY_EPSILON));
		s.append(String.format("\titerationCount: %1$s,\n", iterationCounter));
		s.append("\ttypeToId: \n\t{\n\t");
		for (Map.Entry<String, Integer> e: entrySet){
			if (v.getWord(e.getValue()).frequency >= l.RARE_WORD_THRESHOLD){ //TODO see if necessary
				s.append(String.format("\t\t\"%1$s\": %2$s,\n", e.getKey(), e.getValue()));
			}
		}
		s.append("},\n");
		s.append("\tidToType: {");
		for (Map.Entry<Integer, Word> e: wordSet){ //No rare word check here, to keep vector status
			if (e.getValue().frequency >= l.RARE_WORD_THRESHOLD){
				s.append(String.format("\t\t%1$s: \"%2$s\",\n",e.getKey(), e.getValue().name));	
			}
		}
		s.append("}");
		s.append("\n};");

		try {
			corpusFile.createNewFile();
			BufferedWriter out = new BufferedWriter(new FileWriter(corpusFile));
			out.append(s);
			out.close();
		} catch (IOException e1) {
			// TODO Auto-generated catch block
			e1.printStackTrace();
		}
	}