File size: 694 Bytes
aad7814
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import re
from pathlib import Path

from backend.core.notes_high_confidence_lexicon import HIGH_CONFIDENCE_LEXICON

html = Path("frontend/index.html").read_text(encoding="utf-8")
start = html.index("const highConfidence = [")
end = html.index("];", start) + 2
block = html[start:end]
frontend_entries = re.findall(r"\{\s*code:'([A-N]\d+)',\s*rx:/(.+)/i\s*\}", block)
backend_entries = list(HIGH_CONFIDENCE_LEXICON)
print("fe", len(frontend_entries), "be", len(backend_entries))
for i, (fe, be) in enumerate(zip(frontend_entries, backend_entries, strict=False)):
    if fe[0] != be[0] or fe[1] != be[1]:
        print(i, fe[0], be[0])
        print("  FE:", fe[1])
        print("  BE:", be[1])