Skip to content

Commit 8815951

Browse files
sendclaude
andcommitted
fix: use right_id for prefix check in structure_cost computation
The transition cost is conn_cost(prev.right_id, next.left_id), so the prefix check should use right_id (the outgoing POS) rather than left_id (the incoming POS) of the previous segment. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 7590014 commit 8815951

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

engine/crates/lex-core/src/converter/reranker.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ pub fn rerank(
123123
for i in 1..p.segments.len() {
124124
let mut tc = conn_cost(conn, p.segments[i - 1].right_id, p.segments[i].left_id);
125125
if let Some(c) = conn {
126-
if c.is_prefix(p.segments[i - 1].left_id) {
126+
if c.is_prefix(p.segments[i - 1].right_id) {
127127
tc = tc.max(prefix_floor);
128128
}
129129
}

0 commit comments

Comments
 (0)