def hits

bend-ml-bpe-tokenizer@0.1.3.0 · main.bend:86

import bend-ml-bpe-tokenizer@0.1.3.0/main.bend as BendMlBpeTokenizer
import Base

86# is the newest rule in the table the one that creates the token tk?
87def hits(table: List<&2, Rule>, +tk: Tk) -> Bool:
88  match table:
89    case Nil{}:
90      False{}
91    case Con{Rule{+i, a, b}, rest}:
92      match tk:
93        case B{n}:
94          False{}
95        case M{+j}:
96          Nat.is_eq(i, j)

Uses (5)

Used by (3)