FastType
I wrote a Python script to scrape and convert to JSON the most common words in German and French from the legal codex of the Canton Bern (Belex). Adding this content for a lawmakers remix of the FastType game by Solomon Shalom Lijo. Try it above! Click on the yellow tab to switch modes.
from collections import Counter
import string
import re
# Load text file
file_path = "belex-fr.txt"
with open(file_path, "r") as file:
text = file.read()
# Remove punctuation
text = re.sub(f"[{string.punctuation}]", "", text)
# Tokenize the text
tokens = text.split()
# Remove short words
tokens = [word for word in tokens if len(word)>6]
tokens1w = []
tokens1l = []
for word in tokens:
if not word.lower() in tokens1l:
tokens1w.append(word)
tokens1l.append(word.lower)
# Create a dictionary with word frequencies
word_freq = Counter(tokens1w)
# Print the dictionary
print(word_freq)
Counter({'autorités': 106, 'communes': 89, 'Conseil': 81, 'Conseilexécutif': 71, 'données': 44, 'peuvent': 39, 'Constitution': 36, 'bernoises': 36, 'Recueil': 35, 'personne': 34, 'personnes': 33, 'prestations': 31, 'membres': 31, 'officiel': 31, 'cantonales': 30, 'présente': 27, 'législation': 26, 'dautres': 26, 'publication': 26, 'vigueur': 24, 'cantonale': 22, 'ressources': 22, 'électoral': 21, 'publiques': 21, 'liberté': 20, 'compétences': 20, 'protection': 20, 'populaire': 19, 'législatifs': 19, 'mesures': 18, 'surveillance': 18, 'dispositions': 18, 'Confédération': 17, 'cantonal': 17, 'manière': 17, 'législatif': 17, 'particulier': 16, 'notamment': 16, 'traitement': 16, 'ladministration': 16, 'larticle': 16, 'électronique': 16, ...
del word_freq.most_common()[0]
del word_freq.most_common()[1]
del word_freq.most_common()[2]
words = [k for k,i in word_freq.most_common() if i<50]
words
['données',
'peuvent',
'Constitution',
'bernoises',
'Recueil',
'personne',
...
import json
output_json = "franz.json"
with open(output_json, "w", encoding="utf-8") as json_file:
json.dump(words, json_file, indent=4)
Fast Type
A Fast and Minimal Typing App.
Practice typing in various modes such as common 1k, 5k, 10k English Words, most commonly misspelled words, Quotes or Programming Language keywords for various languages such as JavaScript, HTML, CSS, Rust, Python, C++ etc with Sweet Mechanical Keyboard Sounds.
Awesome Themes

Speed Heatmap
Find your weakness and keep practicing to improve your typing speed.
Mechanical Keyboard Sounds
Super Fast, Minimal and Installable 💯
It is a Progressive Web app that can be installed and can work 100% offline.
Created with
TypeScript
Next.js
,React
SCSS
use-immer
,howler
,next-pwa
Credits for Data Collection
JSON Data for various languages is collected from the amazing MonkeyType Repository.
Previous
Open Legal Lab
Next project