1#[derive(Debug, Clone, Copy, PartialEq, Eq)]
4pub enum MatchType {
5 Prefix,
6 Suffix,
7}
8
9#[derive(Debug, Clone, Copy, PartialEq, Eq)]
10pub enum ConditionScope {
11 Vowel,
12 Consonant,
13 Punctuation,
14 Number,
15 Exact,
16}
17
18#[derive(Debug, Clone, PartialEq, Eq)]
19pub struct RuleCondition {
20 pub match_type: MatchType,
21 pub scope: ConditionScope,
22 pub is_negative: bool,
23 pub exact_value: Box<str>,
24}
25
26#[derive(Debug, Clone, PartialEq, Eq)]
27pub struct PatternRule {
28 pub conditions: Vec<RuleCondition>,
29 pub replace: Box<str>,
30}
31
32#[derive(Debug, Clone, PartialEq, Eq)]
33pub struct Pattern {
34 pub find: Box<str>,
35 pub default_replace: Box<str>,
36 pub rules: Vec<PatternRule>,
37 pub may_have_combining: bool,
38}