1945 Jordan League

Statistics of Jordan League in the 1945 season.

Overview

Al-Faysali won the championship.

gollark: Drugs are UNLEGAL!
gollark: I tried that.
gollark: `False`
gollark: `True`
gollark: ```pythonimport requestsimport randomimport fileinputdef weighted_choice(choices): total = sum(weight for choice, weight in choices) r = random.uniform(0, total) upto = 0 for choice, weight in choices: if upto + weight >= r: return choice upto += weight assert False, "Shouldn't get here"def get_rhymes(word, extra_params={}): default_params = { "rel_rhy": word, "max": 20, "md": "pf" } return requests.get("https://api.datamuse.com/words/", params={**default_params, **extra_params}).json()def get_frequency(word_object): for tag in word_object["tags"]: if tag.startswith("f:"): return float(tag[2:]) return 0def get_rhyme(word, params): options = get_rhymes(word, params) options = list(map(lambda word_object: (word_object["word"], get_frequency(word_object)), options)) if len(options) == 0: return word return weighted_choice(options)last = Nonefor line in fileinput.input(): line = line.replace("\n", "") if last != None: print(line + " " + get_rhyme(last, {})) last = None else: last = line.replace(".", "").split(" ")[-1] print(line)```

References


This article is issued from Wikipedia. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.