jpreprocess-njd 0.15.0

Japanese text preprocessor for Text-to-Speech application (OpenJTalk rewrite in rust language).
Documentation
use super::*;
use phf::{phf_map, phf_set};

pub const CONVERSION_TABLE: [(Keys, NumerativeLUT); 5] = [
    (NUMERATIVE_CLASS2B, CONV_TABLE2B),
    (NUMERATIVE_CLASS2C, CONV_TABLE2C),
    (NUMERATIVE_CLASS2D, CONV_TABLE2D),
    (NUMERATIVE_CLASS2E, CONV_TABLE2E),
    (NUMERATIVE_CLASS2F, CONV_TABLE2F),
];

const NUMERATIVE_CLASS2B: Keys = phf_set! {
    /* from paper */
    "", "", "", "", "", "", /* from dictionary */
    "", "", "", "", "", "", "分間", "分目", "", "", "", "", "", "", "",
    "",
};

const CONV_TABLE2B: NumerativeLUT = phf_map! {
   ""=> DigitType::SemiVoiced,
   ""=> DigitType::SemiVoiced,
   ""=> DigitType::SemiVoiced,
   ""=> DigitType::SemiVoiced,
   ""=> DigitType::SemiVoiced,
   ""=> DigitType::SemiVoiced,
   ""=> DigitType::SemiVoiced,
   ""=> DigitType::SemiVoiced,
   ""=> DigitType::SemiVoiced,
   ""=> DigitType::SemiVoiced,
};

const NUMERATIVE_CLASS2C: Keys = phf_set! {
    /* from paper */
    "",
    "",
    "",
    "",
    "",
    "",
    /* from dictionary */
    "本立て",
    "",
    "",
    "",
};

const CONV_TABLE2C: NumerativeLUT = phf_map! {
   ""=> DigitType::SemiVoiced,
   ""=> DigitType::Voiced,
   ""=> DigitType::SemiVoiced,
   ""=> DigitType::SemiVoiced,
   ""=> DigitType::SemiVoiced,
   ""=> DigitType::SemiVoiced,
   ""=> DigitType::Voiced,
   ""=> DigitType::Voiced,
   ""=> DigitType::Voiced,
};

const NUMERATIVE_CLASS2D: Keys = phf_set! {
   /* from paper */
   /* "羽", "把", *//* modified */
};

const CONV_TABLE2D: NumerativeLUT = phf_map! {
   ""=>DigitType::Voiced,
   ""=>DigitType::SemiVoiced,
   ""=>DigitType::SemiVoiced,
   ""=>DigitType::SemiVoiced,
   ""=>DigitType::SemiVoiced,
   ""=>DigitType::Voiced,
   ""=>DigitType::Voiced,
   ""=>DigitType::Voiced,
};

const NUMERATIVE_CLASS2E: Keys = phf_set! {
   /* from paper */
   "", "", "", "",
   /* from dictionary */
   "かけ", "重ね", "", "",
};

const CONV_TABLE2E: NumerativeLUT = phf_map! {
   ""=>DigitType::Voiced,
   ""=>DigitType::Voiced,
   ""=>DigitType::Voiced,
};

const NUMERATIVE_CLASS2F: Keys = phf_set! {/* from paper */ ""};

const CONV_TABLE2F: NumerativeLUT = phf_map! {
   ""=> DigitType::Voiced,
};