def _concat_ngram_list(ngram_list):
  """Concatenates a list of n-grams.

  Adjacent n-grams in the list are expected to be overlapping, and the
  overlap is not duplicated in the returned concatenation. The contents of the
  n-grams will not be checked however to verify the overlap.

  E.g.
  With ngram_list = ["abc", "bcde", "ef"]
  the concatenation becomes "abcdef"

  Args:
    ngram_list: The list of n-grams to concatenate.

  Returns:
    The concatenation of the n-grams provided.
  """
  result = ngram_list[0]
  for i in range(1, len(ngram_list)):
    prev_ngram = ngram_list[i - 1]
    ngram = ngram_list[i]
    len_overlap = min(len(prev_ngram), len(ngram)) - 1
    result += ngram[len_overlap:]
  return result