Variables are now x/y (45%), any lowercase letter except e and d (35%), any lowercase Greek letter except pi and omicron (15%), or a common uppercase letter like N, F, A (5%). e stays a constant and d is kept for dx and future derivatives. Hand-test exact 41.2% -> 56.9% (trained without #2), variables category 0% -> 87.5%. Fixes #4 Co-authored-by: Paul Tal <[email protected]>
13 lines
450 B
Python
13 lines
450 B
Python
import random
|
|
|
|
from isotope_typst.ast import GREEK, LATIN, UPPER
|
|
from isotope_typst.generate import TreeGen
|
|
|
|
|
|
def test_variable_pool_covers_alphabet():
|
|
"""#4: any letter the model never saw gets spelled out letter by letter, so all of them must show up."""
|
|
gen = TreeGen(random.Random(0))
|
|
seen = {gen.var().name for _ in range(20000)}
|
|
assert set(LATIN) | set(GREEK) | set(UPPER) <= seen
|
|
assert "d" not in seen and "e" not in seen
|