public static void main(String[] args) throws Exception{
	
		ArrayList<ArrayList<Integer>> all_Docs;
		ArrayList<Integer> docSize;
		ReadDataFile rin;
		LSARepresentation lsaRep;
		LSARun lsaRun;
		Object[] matrices=new Object[1];
		HashMap<String,Integer> corpusInt=new HashMap<String,Integer>();
		HashMap<String,Integer> corpusIntOldMapping=new HashMap<String,Integer>();
		LSAWriter wout;
		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.trainUnlab){
		
			System.out.println("+++Inducing LSA Embedddings from unlabeled data+++\n");
			all_Docs=new ArrayList<ArrayList<Integer>>();
			docSize=new ArrayList<Integer>();
			rin=new ReadDataFile(opt);
			corpusInt= rin.convertAllDocsInt(0);
			rin.readAllDocs(0);
			all_Docs=rin.getAllDocs();
			docSize=rin.getDocSizes();
			numTokens=rin.getNumTokens();
			rin.serializeCorpusIntMapped();
			
			lsaRep= new LSARepresentation(opt, numTokens,rin,all_Docs);
			lsaRun=new LSARun(opt,lsaRep,all_Docs);
			lsaRun.serializeLSARun();
			matrices=deserializeLSARun(opt);
			wout=new LSAWriter(opt,all_Docs,(Matrix)matrices[0],rin);
			wout.writeEigenDict();
			System.out.println("+++LSA Embedddings Induced+++\n");
			
			if (opt.randomBaseline){
				wout.writeEigenDictRandom();
			}
			
		}
		if (opt.train){
			System.out.println("+++Generating LSA Embedddings for training data+++\n");
			all_Docs=new ArrayList<ArrayList<Integer>>();
			docSize=new ArrayList<Integer>();
			corpusIntOldMapping=deserializeCorpusIntMapped(opt);
			rin=new ReadDataFile(opt);
			rin.setCorpusIntMapped(corpusIntOldMapping);
			rin.readAllDocs(1);
			all_Docs=rin.getAllDocs();
			docSize=rin.getDocSizes();
			numTokens=rin.getNumTokens();
			//corpus=new Corpus(all_Docs,docSize,opt);
			matrices=deserializeLSARun(opt);
			lsaRep= new LSARepresentation(opt, numTokens,rin,all_Docs);
			
			
			Matrix contextObliviousEmbed=lsaRep.getContextOblEmbeddings((Matrix)matrices[0]);

			wout=new LSAWriter(opt,all_Docs,(Matrix)matrices[0],rin);
			
			
			wout.writeContextObliviousEmbed(contextObliviousEmbed);
			
			if (opt.randomBaseline){
				wout.writeContextObliviousEmbedRandom();
			}
			
			System.out.println("+++Generated LSA Embedddings for training data+++\n");
		}
	
	}