private static double calculateTrigrams(int[] asciiCodes) {

		int stringLength = asciiCodes.length;
		int maxIndNgram = stringLength - 3;

		double localLikelihood = 0;

		double[][] beginTrigramProbs = logProbs.getBeginLogTrigrams();
		double[][] endTrigramProbs = logProbs.getEndLogTrigrams();
		double[][][] trigramProbs = logProbs.getLogTrigrams();

		// We can't calculate a score for strings less than length 3
		// Note: length of string is checked by calling method, but leave this here just in case
		if (stringLength < 3) {
			return defaultLogValue;
		}

		int charIndex = 1;
		localLikelihood += beginTrigramProbs[asciiCodes[0]][asciiCodes[1]];

		while (charIndex <= maxIndNgram) {
			localLikelihood +=
				trigramProbs[asciiCodes[charIndex]][asciiCodes[charIndex + 1]][asciiCodes[charIndex + 2]];
			charIndex++;
		}

		// Get end-of-string trigram score
		localLikelihood += endTrigramProbs[asciiCodes[charIndex]][asciiCodes[charIndex + 1]];

		return localLikelihood / stringLength;
	}
Calculate the score for the given ASCII string (characters represented by ASCII codes)

@param asciiCodes  ASCII codes that represent the characters for candidate string
@return  score for the given string
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/string/NGramUtils.java