Last active
August 17, 2017 13:06
-
-
Save nozma/9cb4d3553946a5af7386df948c3132f8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # coding: utf-8 | |
| def n_gram(n, s): | |
| return [s[i:i+n] for i in range(0, len(s)-n+1)] | |
| print(n_gram(2, 'I am an NLPer')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment