Skip to content

Instantly share code, notes, and snippets.

@guilhermefgs
Last active October 11, 2020 19:41
Show Gist options
  • Save guilhermefgs/1733a349925321676cb3d2ad0bd41630 to your computer and use it in GitHub Desktop.
Save guilhermefgs/1733a349925321676cb3d2ad0bd41630 to your computer and use it in GitHub Desktop.
import nltk
# id do corpus
# no nosso caso estamos usando id machado
nltk_id = 'machado'
# eh necessario baixar o corpus
nltk.download(nltk_id)
# agora o corpus esta acessivel
# visualizando as obras disponiveis
print(nltk.corpus.machado.readme())
# ou
print(nltk.corpus.machado.fileids())
# apos escolher a obra
# salvamos a string em uma variavel
dom_casmurro = nltk.corpus.machado.raw('romance/marm08.txt')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment