-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdispatch_partial_ratio.go
More file actions
46 lines (43 loc) · 2.09 KB
/
Copy pathdispatch_partial_ratio.go
File metadata and controls
46 lines (43 loc) · 2.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// Copyright 2026 AxonOps Limited
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// dispatch_partial_ratio.go registers PartialRatioScore (the sole
// PartialRatio surface post Phase 8.5 Q5) into the dispatch table at
// package load time. This file MUST be the sole writer to
// dispatch[AlgoPartialRatio] (slot 16 — see algoid.go AlgoPartialRatio).
//
// Per Phase 8.5 Q5 LOCKED (08.5-CONTEXT.md Q5; plan 08.5-03): PartialRatio
// ships a single byte-path surface — the former rune-variant was removed
// because token-tier algorithms operate on the output of Tokenise (which
// is itself rune-aware) and the byte-level Indel kernel is correct on
// post-Tokenise byte strings.
//
// PartialRatioScore has no parameters beyond (a, b string), so the
// dispatch wrapper is the function value directly — NO closure is
// needed (mirrors dispatch_lcsstr.go, dispatch_token_sort_ratio.go,
// dispatch_token_set_ratio.go). This contrasts with the q-gram
// dispatchers in plans 05-01 through 05-04, which bind a default n
// parameter via a closure.
//
// See algoid.go for the dispatch array declaration and its design
// rationale.
package fuzzymatch
// init registers the PartialRatio dispatch entry. Q14b option A
// (Phase 8.5 Plan 15a) — explicit init replaces the var _ = func() bool
// {...}() pattern per the determinism-standards SKILL (pure-write into a
// pre-allocated slot; no IO, no time, no goroutines, no ordering
// dependency on other init functions). No closure: PartialRatioScore's
// signature already matches the dispatch table type.
func init() {
dispatch[AlgoPartialRatio] = PartialRatioScore
}