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
use std::rc::Rc;
#[derive(Debug)]
pub struct ViterbiNode {
pub cost: i32,
pub prev: Option<Rc<ViterbiNode>>,
pub word_id: i32,
pub left_id: i16,
pub right_id: i16,
pub start: usize,
pub length: i16,
pub is_space: bool
}
impl ViterbiNode {
pub fn make_boseos() -> ViterbiNode {
ViterbiNode {
word_id: 0,
start: 0,
length: 0,
cost: 0,
left_id: 0,
right_id: 0,
is_space: false,
prev: None
}
}
}