private static double[] buildScoreArray(String string, String abbreviation) {
            double[] scores = new double[string.length()];
            String lower = string.toLowerCase();
            String chars = abbreviation.toLowerCase();

            int lastIndex = -1;
            boolean started = false;
            for (int i = 0; i < chars.length(); i++) {
                char c = chars.charAt(i);
                int index = lower.indexOf(c, lastIndex + 1);

                if (index == -1)
                    return null; // signal no match
                if (index == 0)
                    started = true;

                if (isNewWord(string, index)) {
                    scores[index - 1] = 1.0;
                    fillArray(scores, SCORE_BUFFER, lastIndex + 1, index - 1);
                } else if (isUpperCase(string, index)) {
                    fillArray(scores, SCORE_BUFFER, lastIndex + 1, index);
                } else {
                    fillArray(scores, SCORE_NO_MATCH, lastIndex + 1, index);
                }

                scores[index] = SCORE_MATCH;
                lastIndex = index;
            }

            double trailingScore = started ? SCORE_TRAILING_BUT_STARTED : SCORE_TRAILING;
            fillArray(scores, trailingScore, lastIndex + 1, scores.length);
            return scores;
        }