2015-11-21から1日間の記事一覧
(python2.7) def ngrams(text, n): text_list = list(text) return [text_list[i:i + n] for i, char in enumerate(text_list)] ngrams_list = ngrams(u"今日はいい天気ですね。", 2) print(("\n").join([u"{}".format(u"".join(chars)).encode('utf8') for …