X-Git-Url: https://git.njae.me.uk/?a=blobdiff_plain;f=riddle_definitions.md;h=1db01f7b1bcc338759f74ee6f8e6a9569b2622e3;hb=1d2814738b8ce6cb2930c22eebeed1c4cb3ed63b;hp=a9242f362736e34ad44c42aa259e1952705d1e4e;hpb=52008779b0281639e17a6570271dc7d5a3227b03;p=riddle-generator.git diff --git a/riddle_definitions.md b/riddle_definitions.md index a9242f3..1db01f7 100644 --- a/riddle_definitions.md +++ b/riddle_definitions.md @@ -6,17 +6,13 @@ jupyter: extension: .md format_name: markdown format_version: '1.3' - jupytext_version: 1.15.0 + jupytext_version: 1.14.5 kernelspec: display_name: Python 3 (ipykernel) language: python name: python3 --- -# Definitions generally useful for the riddle solver - -While this file is here as a Markdown file, it's intended that Jupytext will save this file as a "percent" Python file, so that it can be imported by other notebooks here. - ```python import unicodedata import re @@ -125,19 +121,6 @@ def edit_distance(s: str, t: str) -> int: return res ``` -```python -dictionary_neighbours = { - w: [o for o in dictionary - if edit_distance(w, o) <= 5 - if not set(w) <= set(o) - if not set(o) <= set(w)] - for w in dictionary} - -dictionary_neighbours = {w: ns - for w, ns in dictionary_neighbours.items() - if ns} -``` - ```python def collapse_riddle_clues(elems : Riddle) -> RiddleElems: """Combine the two parts of a riddle line into one element for solving.