public static void main(String[] args) throws Exception{
		
		Object[] all_Docs;
		ArrayList<Integer> docSize;
		ReadDataFile rin;
		//Corpus corpus;
		ContextPCANGramsRepresentation contextPCANGramsRep;
		HashMap<String,Integer> corpusInt=new HashMap<String,Integer>();
		HashMap<String,Integer> corpusIntOldMapping=new HashMap<String,Integer>();
		CCAVariantsNGramsRun ccaVariantNGramRun;
		ContextPCANGramsWriter woutNGrams;
		Object[] matrices=new Object[2];
		long numTokens;
		
		Options opt=new Options(args);
		
		if(opt.algorithm==null){
			System.out.println("WARNING: YOU NEED TO SPECIFY A VALID ALGORITHM NAME AS algorithm:");
		}
		if(opt.numGrams ==2 && !opt.typeofDecomp.equals("2viewWvsR")){
			System.out.println("WARNING: WITH BIGRAMS YOU CAN ONLY RUN W vs R; FOR OTHER VARIANTS E.G W vs [L R] TRY 3 OR 5 GRAMS");
			System.exit(0);
		}
		
		
		if(opt.trainUnlab){
			System.out.println("+++Inducing CCA Ngrams Embedddings from unlabeled data+++\n");
			//all_Docs=new HashMap<Double, Integer>();
			docSize=new ArrayList<Integer>();
			rin=new ReadDataFile(opt);
			if (opt.depbigram){
				corpusInt= rin.convertAllDocsIntNGrams();
				rin.readAllDocsNGrams();
				all_Docs=rin.getAllDocsNGrams();
			}
			else{
				corpusInt= rin.convertAllDocsIntNGramsSingleVocab();
				rin.readAllDocsNGramsSingleVocab();
				all_Docs=rin.getAllDocsNGrams();
			}
			rin.serializeCorpusIntMapped();
			numTokens=rin.getNumTokens();
			rin.serializeCorpusIntMappedContext();
			
			
			contextPCANGramsRep= new ContextPCANGramsRepresentation(opt, numTokens,rin, all_Docs);
			
		    /* Total memory currently in use by the JVM */
		    System.out.println("Total memory (bytes): " + 
		        Runtime.getRuntime().totalMemory());
			
			
			ccaVariantNGramRun=new CCAVariantsNGramsRun(opt,contextPCANGramsRep);
			ccaVariantNGramRun.serializeCCAVariantsNGramsRun();
			matrices=deserializeCCAVariantsNGramsRun(opt);

			woutNGrams=new ContextPCANGramsWriter(opt,all_Docs.length,matrices,rin);
			woutNGrams.writeEigenDict();
			if(!opt.typeofDecomp.equals("TwoStepLRvsW"))
				woutNGrams.writeEigContextVectors();
			
		    /* Total memory currently in use by the JVM */
		    System.out.println("Total memory (bytes): " + 
		        Runtime.getRuntime().totalMemory());
			
			if (opt.randomBaseline){
				woutNGrams.writeEigenDictRandom();
				woutNGrams.writeEigContextVectorsRandom();
			}
			System.out.println("+++CCA NGram Embedddings Induced+++\n");
		}
	
	}