public static char[] generateFrequencyAlphabet(int base,
                                                   String[] trainingData) {
    	//check input parameters
    	if(base<0)
    		return null;
    	
    	if(base==0 || trainingData.length==0)
    		return new char[0];
    	
    	int totalNumChars = 0;
    	Map<Character,Double> charFrequencies = getZeroCharFrequencies();
    	
    	for(String str : trainingData){
    		str = str.toLowerCase();
    		
    		for(int i=0; i<str.length(); i++){
    			if(str.substring(i,i+1).matches("[a-z]")){ //note use of substring to get character, so I can use matches() function
    				charFrequencies.put(str.charAt(i), charFrequencies.get(str.charAt(i))+1);
    				totalNumChars++;
    			}
    		}
    	}
    	
    	if(totalNumChars==0)
    		return new char[0];
    	
    	return convertToCDF(charFrequencies,totalNumChars,base);
    }