Does light charge the quons? › Files cited on the page › check_lattices_fable/
page_checks.py
"""Read the fetched public pages as data and report what the review needs. Run with python3 -I."""
import html, re, sys
D = sys.argv[1]
def text(fn):
s = open(f"{D}/{fn}", encoding="utf-8", errors="replace").read()
s = re.sub(r"<script.*?</script>|<style.*?</style>", " ", s, flags=re.S)
s = re.sub(r"<[^>]+>", " ", s)
s = html.unescape(s)
return re.sub(r"\s+", " ", s)
def show(t, pat, width=260, maxn=6):
n = 0
for m in re.finditer(pat, t):
a = max(0, m.start() - width // 2); print(" ...", t[a:a + width].strip(), "...")
n += 1
if n >= maxn: break
if n == 0: print(" (no match)")
t = text("2edpocch1.html")
print("2edpocch1: Earnshaw", len(re.findall(r"Earnshaw", t)), "Earlshaw", len(re.findall(r"Earlshaw", t)))
show(t, r"Earnshaw", 120, 6)
t = text("masch09.html")
print("\nmasch09: 'all negative' passages")
show(t, r"all negative", 420, 3)
print("masch09: 'continuum which is positive'")
show(t, r"continuum which is positive", 420, 3)
for fn, label in (("aether-units.html", "Part 1"), ("quon-model.html", "Part 1A"), ("test-register.html", "Register")):
t = text(fn)
print(f"\n{label}: version strings")
show(t, r"Version 1\.\d", 300, 2)
print(f"{label}: '2d' sentences")
show(t, r"2d/√3|2d/√3|2√3", 330, 6)
print(f"{label}: '+0.003'")
show(t, r"\+0\.003", 400, 3)
print(f"{label}: 'shorter than 2d'")
show(t, r"shorter than 2d", 300, 4)