Atelier des rouesLab FR
Objects/Documentation

contextes.py

Reproducible program or output for the compression dossier.

Download ↓
"""Binary order-two types, rank and inverse checked against all eight-bit strings."""
from collections import defaultdict
from functools import lru_cache
from itertools import product
import json


def counts(word):
    c=[0]*8
    for a,b,t in zip(word,word[1:],word[2:]):
        c[4*a+2*b+t]+=1
    return tuple(c)


def next_state(ctx,edges,bit):
    index=2*ctx+bit

Read in context

Comments

Comments from both language editions appear here.

The discussion is open for reading. I’ll enable submissions once spam protection is configured.