Skip to content

Instantly share code, notes, and snippets.

View pcmill's full-sized avatar

Pieter van Mill pcmill

View GitHub Profile
@pcmill
pcmill / app.py
Created August 24, 2018 18:09
Word frequenty to CSV.
import csv
file = open('sentences.txt', 'r', encoding="utf8")
book = file.read()
def tokenize():
if book is not None:
words = book.lower().split()
return words
else:
@pcmill
pcmill / wordcounter.py
Created August 24, 2018 18:01
Some code to compute the corpus size.
file = open('sentences.txt', 'r', encoding="utf8")
sentences = file.read()
def tokenize():
if sentences is not None:
words = sentences.lower().split()
return words
else:
return None