#!/usr/bin/python
# -*- coding: utf-8 -*-

def ngram_print(num, target):
    for i in range(len(target)):
        print target[i:(num+i)]


if __name__ == '__main__':
    num = 2
    target = 'I am an NLPer'

    print '----- 文字 -----'
    ngram_print(num, list(target))
    print '----- 単語 -----'
    ngram_print(num, target.split(' '))
