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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
//! Pronunciation CLI arguments
use clap::{Args, Subcommand};
/// Pronunciation arguments
#[derive(Args)]
pub struct PronunciationArgs {
#[command(subcommand)]
pub command: PronunciationCommands,
}
#[derive(Subcommand)]
pub enum PronunciationCommands {
/// List pronunciation dictionaries
List,
/// Add a pronunciation dictionary
Add {
/// PLS file path
#[arg(long)]
file: String,
/// Dictionary name
#[arg(short, long)]
name: String,
/// Description
#[arg(short, long)]
description: Option<String>,
},
/// Delete a pronunciation dictionary
Delete {
/// Dictionary ID
dictionary_id: String,
},
/// List rules in a pronunciation dictionary
Rules {
/// Dictionary ID
dictionary_id: String,
},
/// Add rules to a pronunciation dictionary
AddRules {
/// Dictionary ID
dictionary_id: String,
/// JSON file containing rules
#[arg(short, long)]
rules_file: String,
},
/// Remove rules from a pronunciation dictionary
RemoveRules {
/// Dictionary ID
dictionary_id: String,
/// JSON file containing rules
#[arg(short, long)]
rules_file: String,
},
/// Download PLS file for a pronunciation dictionary
GetPls {
/// Dictionary ID
dictionary_id: String,
/// Output file path
#[arg(short, long)]
output: String,
},
}