class TranscribeUtils {

    public static String getFirstWords(String text, int numberOfWords)
    {
        if (text != null)
        {
            String[] words = StringUtils.split(text, " ");
            return words.length > numberOfWords ? StringUtils.join(words, " ", 0, numberOfWords) + " ..."
                    : StringUtils.join(words, " ", 0, words.length);
        }

        return "";
    }

}