private void predictionShowResults(int predictionNumber, String[] inputText) {
		// storing the input text
		Set<String> input = new LinkedHashSet<String>(Arrays.asList(inputText));
		// storing the contexts supplied as part of input that have suggestion
		// results
		Set<String> inputHaveResults = new LinkedHashSet<String>(
				Arrays.asList(inputText));
		// storing the contexts supplied as part of input into the array
		this.inputHaveResultsArray = null;
		boolean HAVERESULTS = false;
		((ResultPanel) resultsPanel).SetResultText(" ");

		for (String s : input) {
			try {
				// Getting the predictions from the service
				HAVERESULTS = ngramsMap.getNGramsFromService(s,
						predictionNumber);
				// If the phrase has no results, then delete it from the list
				if (HAVERESULTS == false) {
					inputHaveResults.remove(s);
				}
			} catch (NGramException e1) {
				// If the correct result is not retrieved from the NGramService,
				// then showing a warning message
				if (resultsPanel != null) {
					((ResultPanel) resultsPanel).SetResultText(" ");
				}
				JOptionPane.showMessageDialog(this,
						"Please input valid contexts!");
				return;
			}

		}
		// Changing the list to a string array
		inputHaveResultsArray = new String[inputHaveResults.size()];
		int index = 0;
		for (String s : inputHaveResults) {
			inputHaveResultsArray[index] = s;
			index++;
		}

		String resultsString = displayResults(
				input.toArray(new String[input.size()]), ngramsMap);
		// Displaying the results on the text field
		((ResultPanel) resultsPanel).SetResultText(resultsString);
	}