Last active
August 29, 2015 14:16
-
-
Save cmarat/ecb902729a90c3352591 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
import nltk | |
cond = lambda s: any((pos == 'JJ' and len(word) > 4 and word[-3:] == 'ate' for word, pos in s)) | |
sents = (s for s in nltk.corpus.brown.tagged_sents() if len(s) > 4 and len(s) < 16 and cond(s)) | |
for sent in sents: | |
print(" ".join(zip(*sent)[0])) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Output: