This file contains 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 -*- | |
import re | |
from random import shuffle | |
look_for = 'áàãâéêçíóôõúü' | |
omit = '[,:;.()!"?]' | |
max_amount = 2000000 | |
pattern = r'[^\s]*'+ '[' + re.escape(look_for) + ']' + r'[^\s]*' | |
found_words = [] |
This file contains 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
''' | |
An interpretation of a work by Timm Ulrichs | |
see this blog post: https://letterformarchive.org/news/shaped-text | |
See other solutions in this twitter-thread: | |
https://twitter.com/MauriceMeilleur/status/1329218247594561538 | |
''' | |
# --------------- | |
# S E T T I N G S |
This file contains 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
# a simple script to generate pdfs of (german) text converted to braille. | |
# this script need the drawbot app! | |
# This follows the DIN 32976 | |
# a list of words | |
words = [ | |
'This should output braille', | |
] | |
dot_s = 16 # the dot size 1.6mm |
This file contains 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
from collections import Counter | |
# Change the path to whatever file you want to be read | |
pth = 'MOBY-DICK.txt' | |
with open(pth) as f: | |
words = f.read().lower().split() | |
ct = Counter(words) | |
print (ct.most_common(100)) |