@Override
	public void setPredictions(String[] predictions) throws NGramException {

		/*
		 * if ((predictions == null) || ((predictions != null) &&
		 * (predictions.length == 0))) { throw new NGramException("ERROR:"); }
		 * if (predictions.length > 0) { for (String s : predictions) { if ((s
		 * == null) || (s.isEmpty())) { throw new
		 * NGramException("ERROR:predictions contain" +
		 * "at least one empty or null string"); } } } predictions string[]
		 * count = predictions.length; for (String s : predictions) {
		 * this.predictions[count] = s;// add the new predictions words count++;
		 * } this.predictions = predictions;
		 */
		// new version use the checkArray check prediction,and use list store
		// the prediction
		if (checkArray(predictions) == false) {
			throw new NGramException(
					"ERROR: predictions is null or empty or contains at least one empty or null string ");
		}

		predictionsList.clear();
		for (String s : predictions) {
			predictionsList.add(s);
		}
	}