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
# Obtained from http://code.activestate.com/recipes/252124-latex-codec/ | |
latex_equivalents = { | |
0x0009: ' ', | |
0x000a: '\n', | |
0x0023: '{\#}', | |
0x0026: '{\&}', | |
0x00a0: '{~}', | |
0x00a1: '{!`}', | |
0x00a2: '{\\not{c}}', | |
0x00a3: '{\\pounds}', |
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 requests | |
from bs4 import BeautifulSoup | |
from tqdm import tqdm | |
def get_ipa(html): | |
soup = BeautifulSoup(html, 'html5lib') | |
ipa_spans = soup.findAll('span', {'class': 'IPA'}) | |
return [span.text[1:-1] for span in ipa_spans] |
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 slacker import Slacker | |
import os | |
def yellow(s): | |
return '\033[93m' + str(s) + '\033[0m' | |
try: | |
# How to obtain a legacy token: https://get.slack.help/hc/en-gb/articles/215770388-Create-and-regenerate-API-tokens | |
slack = Slacker(os.environ.get('SLACK_TOKEN')) | |
except: |