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. |
||
|---|---|---|
| .. | ||
| test_analyze.py | ||
| test_bex.py | ||
| test_crx_refined.py | ||
| test_distributional.py | ||
| test_ensemble.py | ||
| test_gbnf.py | ||
| test_grammar_index.py | ||
| test_kore.py | ||
| test_reduce.py | ||
| test_scoring.py | ||