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
import re | |
class Lixer: | |
def __init__(self) -> None: | |
# Your one stop shop in changable variables! Come on in, come on down. We got regex and some other shit. | |
self.punctuation_regex = r"[.:!?]" | |
self.clean_regex = r"[\.\,\:\!\?\-\\\/\(\)\[\]\;\*\'\"\#\$\@\+0-9\_\n\t]" | |
self.capitalised_word_regex = r"([A-ZÆØÅ][a-zæøå]+)" | |
self.complex_threshold = 6 | |
def _count_capitalised_words(self, text: str) -> int: |
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
import string | |
from setfit import SetFitModel | |
class Caesar: | |
"""My name is Julius and I'm here to say, | |
jhwwlqj vwdeehg zloo nhhs olih dw edb""" | |
def __init__(self, lang = "en") -> None: | |
# Bilingual appalicious | |
self.alphabets = { | |
"en": string.ascii_lowercase, |
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 -*- | |
elder_rune_dict = { | |
"a": "ᚨ", | |
"b": "ᛒ", | |
"c": "ᚲ", | |
"d": "ᛞ", | |
"e": "ᛖ", | |
"f": "ᚠ", | |
"g": "ᚷ", |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
""" | |
OdaWrapper er et lille script til på nemmere møde at aggregere | |
data fra oda.ft.dk. Odata er servicen hvor Borgen lægger deres | |
stemmer, sager og personer mv. op. | |
De har nok med vilje gjort det lidt uoverskuelig, og dette | |
script kræver stadig at man kender de forskellige tabeller. | |
""" | |
from math import ceil |