Lines Matching refs:segmentation
30 std::vector<SegmentationEntry> segmentation( in Encode() local
35 if (i > 0 && segmentation[i].previous_pos < 0) { in Encode()
43 const float unknown_penalty = segmentation[i].score + unknown_score_; in Encode()
44 if (segmentation[pos].previous_pos < 0 || in Encode()
45 segmentation[pos].score < unknown_penalty) { in Encode()
47 if (segmentation[i].piece_id == unknown_code_) { in Encode()
48 segmentation[pos] = {/*score=*/unknown_penalty, in Encode()
49 /*previous_pos=*/segmentation[i].previous_pos, in Encode()
51 /*num_pieces=*/segmentation[i].num_pieces}; in Encode()
53 segmentation[pos] = {/*score=*/unknown_penalty, in Encode()
56 /*num_pieces=*/segmentation[i].num_pieces + 1}; in Encode()
69 const float candidate_score = segmentation[i].score + scores_[match.id]; in Encode()
70 if (segmentation[pos].previous_pos < 0 || in Encode()
71 segmentation[pos].score < candidate_score) { in Encode()
72 segmentation[pos] = {/*score=*/candidate_score, /*previous_pos=*/i, in Encode()
74 /*num_pieces=*/segmentation[i].num_pieces + 1}; in Encode()
80 if (segmentation[len].num_pieces <= 0) { in Encode()
84 const int num_pieces = segmentation[len].num_pieces; in Encode()
89 (*encoded_text)[i] = segmentation[pos].piece_id; in Encode()
90 pos = segmentation[pos].previous_pos; in Encode()