public FloatElement[] getSortedSimilarWordsByDelta(String word) throws Exception{
		
		int index = model1.index(word);
		FloatElement[] similarWords = new FloatElement[model1.sizeOfVocabulary];
		//float invalid = -10;
		
		for (int i=0; i<model1.sizeOfVocabulary; i++){
			
			float pmi1 = 0;
			float pmi2 = 0;
			float similarity = Float.NEGATIVE_INFINITY;
			
			try {
				pmi2 = model2.getPMI(index, i);
				//if (pmi2 < BASE_PMI) pmi2 = BASE_PMI;
			
			} catch (Exception e) {

				// if not exist in the smaller window
				try {
					pmi1 = model1.getPMI(index, i);
					
					if (REMOVE_NON_FREQUENT_WORDS && model1.getFrequency(i) < model1.totalWords / model1.FrequencyLimit) 
						similarity = 0; // exclude rarely appearing words
					else{
						similarity = deltaPMI(pmi1, BASE_PMI);
						
						/* 
						if (model1.getCoOccurrence(index, i) > 10) 
							similarity = combinedPMI(pmi1, BASE_PMI);
						else
							similarity = pmi1; // + CORPUS_PMI_DELTA;
						*/
						
					}
					
				} catch (Exception e2) {
					// TODO Auto-generated catch block
					similarity = 0;
				}
				
			}
			
			if (similarity == Float.NEGATIVE_INFINITY){
				
				try {
					pmi1 = model1.getPMI(index, i);
					
					/*
					if ((double) model1.getCoOccurrence(index, i) / model1.getFrequency(index) < model1.CONDITIONAL_THRESHOLD)
						similarity = invalid;
					else
					*/ 
						
					if (REMOVE_NON_FREQUENT_WORDS && model1.getFrequency(i) < model1.totalWords / model1.FrequencyLimit) 
						similarity = 0; // exclude rarely appearing words
					else
						similarity = deltaPMI(pmi1, pmi2);
					
				} catch (Exception e) {
					// TODO Auto-generated catch block
					//throw new Exception("Error in program! The two words " + word + " " + model1.vocabulary[i] + " do not co-occur in the bigger window but co-occur in the smaller window");
					similarity = 0;
				}
				
			}
			
			FloatElement element = new FloatElement(model1.vocabulary[i], similarity);
			similarWords[i] = element;
		}
		
		Arrays.sort(similarWords);
		
		return similarWords;
		
	}