class BreakIteratorStringProvider extends AbstractStringProvider implements StringProviderMXBean {

	@Override
	public List<String>[] getNgrams(String text, String language_code) throws Exception {
		LOG.trace(String.format("Computing ngrams from text: %s", StringUtils.abbreviate(text, 200)));
		List<String>[] ngrams = null;

		for(String sentence : splitSentences(text, language_code)){
			List<String> tokens = tokenizeSentence(sentence, language_code);
			if(tokens.isEmpty())
				continue;
			LOG.trace(String.format("Current sentence: %s", StringUtils.abbreviate(tokens.toString(), 200)));
			List<String>[] current_ngrams = getNgramSequenceFromSentence(tokens);

			LOG.trace(String.format("Current ngrams: %s", StringUtils.abbreviate(Arrays.toString(current_ngrams), 200)));
			if (ngrams == null)
				ngrams = current_ngrams;
			else
				ngrams = ArrayUtils.getConcatinatedArray(ngrams, current_ngrams);
		}

		if (ngrams == null)
			ngrams = EMPTY_NGRAM_LIST;
		LOG.trace(String.format("Ngrams for text: '%s': %s ", StringUtils.abbreviate(text, 200), StringUtils.abbreviate(Arrays.toString(ngrams), 200)));
		return ngrams;
	}

}