Skip to main content

ConnectionCost

Trait ConnectionCost 

Source
pub trait ConnectionCost {
    // Required method
    fn cost(&self, right_id: u16, left_id: u16) -> i32;
}
Expand description

연접 비용 조회 인터페이스

두 형태소 간의 연결 비용을 반환합니다. 이 비용은 matrix.def에서 학습된 값입니다.

Required Methods§

Source

fn cost(&self, right_id: u16, left_id: u16) -> i32

두 문맥 ID 간의 연접 비용 반환

§Arguments
  • right_id - 이전 노드의 우문맥 ID
  • left_id - 현재 노드의 좌문맥 ID
§Returns

연접 비용 (낮을수록 좋음)

Implementors§

Source§

impl ConnectionCost for FixedConnectionCost

Source§

impl ConnectionCost for ZeroConnectionCost

Source§

impl<T: Matrix> ConnectionCost for T

mecab-ko-dict의 Matrix trait에 대한 ConnectionCost 구현

사전 모듈의 연접 비용 행렬을 Viterbi 알고리즘에서 직접 사용할 수 있습니다.