def shingle(input, k):
    """Shingles the input in k length ngrams"""
    if k < 2:
        return input
    output = []
    for index in range(0, len(input) - k + 1):
        output.append(input[index:index + k])
    return output
