grammar-inference-engine/tests
tobjend 841f5efcf5 feat: distributional clustering for better grouping (Phase 1)
Inspired by Crucio's distributional matrix (ICSE 2026).
Groups symbols by context similarity instead of first-symbol.

New module: bex/distributional.py
- extract_contexts(): get (left, right) context pairs
- build_distribution_matrix(): symbol × context counts
- cluster_symbols(): agglomerative clustering by similarity
- split_by_cluster(): split sequences by cluster membership
- distributional_split(): drop-in replacement for _split_by_first_symbol

CLI: --cluster-method distributional (opt-in, first-symbol is default)

Example: 'if' and 'while' both appear before 'return'
→ first-symbol: 3 groups (if, while, return)
→ distributional: 2 groups (if/while merged, return)

23 tests pass. Full suite: 257 tests pass.
2026-07-12 17:37:36 +02:00
..
test_analyze.py feat: iDRegEx refinement for CRX flat bags (Round 16) 2026-07-12 16:54:40 +02:00
test_bex.py clean up agent-betraying comments; fix stale test names 2026-07-01 13:26:03 +02:00
test_crx_refined.py feat: CRX refined — cluster-then-infer for tighter grammars 2026-07-12 01:50:40 +02:00
test_distributional.py feat: distributional clustering for better grouping (Phase 1) 2026-07-12 17:37:36 +02:00
test_ensemble.py drop kORE from default ensemble, add --kore flag to opt in 2026-07-04 02:58:07 +02:00
test_gbnf.py fix(gbnf): handle disjunction inside parens and compound repetition 2026-07-12 02:20:58 +02:00
test_grammar_index.py feat: grammar index for runtime lookup 2026-07-12 14:08:05 +02:00
test_kore.py WIP: language size scoring + diversity threshold (step 1 pending) 2026-07-11 22:56:42 +02:00
test_reduce.py feat: implement Reduce algorithm (Algorithm 4, TODS 2010) 2026-07-12 00:11:38 +02:00
test_scoring.py WIP: language size scoring + diversity threshold (step 1 pending) 2026-07-11 22:56:42 +02:00