Skip to content

Commit

Permalink
proper fullcontext_label
Browse files Browse the repository at this point in the history
  • Loading branch information
cm-ayf committed Jan 15, 2024
1 parent ec4265d commit 38e879c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
19 changes: 14 additions & 5 deletions src/fullcontext_label.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct Label {
pub phoneme: Phoneme,
pub mora: Option<Mora>,
Expand All @@ -13,14 +14,16 @@ pub struct Label {
pub utterance: Utterance,
}

#[derive(Debug, Clone, PartialEq, Eq)]
pub struct Phoneme {
pub p2: String,
pub p1: String,
pub c: String,
pub n1: String,
pub n2: String,
pub p2: Option<String>,
pub p1: Option<String>,
pub c: Option<String>,
pub n1: Option<String>,
pub n2: Option<String>,
}

#[derive(Debug, Clone, PartialEq, Eq)]
pub struct Mora {
/// the difference between accent type and position of the current mora identity
pub relative_accent_position: i8,
Expand All @@ -30,6 +33,7 @@ pub struct Mora {
pub position_backward: u8,
}

#[derive(Debug, Clone, PartialEq, Eq)]
pub struct Word {
/// pos (part-of-speech) of the word
pub pos: Option<u8>,
Expand All @@ -39,6 +43,7 @@ pub struct Word {
pub cform: Option<u8>,
}

#[derive(Debug, Clone, PartialEq, Eq)]
pub struct AccentPhraseCurrent {
/// the number of moras in the current accent phrase
pub mora_count: u8,
Expand All @@ -56,6 +61,7 @@ pub struct AccentPhraseCurrent {
pub mora_position_backward: u8,
}

#[derive(Debug, Clone, PartialEq, Eq)]
pub struct AccentPhrasePrevNext {
/// the number of moras in the accent phrase
pub mora_count: u8,
Expand All @@ -67,6 +73,7 @@ pub struct AccentPhrasePrevNext {
pub is_pause_insertion: Option<bool>,
}

#[derive(Debug, Clone, PartialEq, Eq)]
pub struct BreathGroupCurrent {
/// the number of accent phrases in the current breath group
pub accent_phrase_count: u8,
Expand All @@ -86,13 +93,15 @@ pub struct BreathGroupCurrent {
pub mora_position_backward: u8,
}

#[derive(Debug, Clone, PartialEq, Eq)]
pub struct BreathGroupPrevNext {
/// the number of accent phrases in the breath group
pub accent_phrase_count: u8,
/// the number of moras in the breath group
pub mora_count: u8,
}

#[derive(Debug, Clone, PartialEq, Eq)]
pub struct Utterance {
/// the number of breath groups in this utterance
pub breath_group_count: u8,
Expand Down
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
mod fullcontext_label;
3 changes: 0 additions & 3 deletions src/main.rs

This file was deleted.

0 comments on commit 38e879c

Please sign in to comment.