bamboo_core/mode.rs
1use bitflags::bitflags;
2
3/// Represents the processing mode of the engine.
4#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
5pub enum Mode {
6 /// Process input using Vietnamese transformation rules.
7 #[default]
8 Vietnamese,
9 /// Treat input as plain English (no transformations).
10 English,
11}
12
13bitflags! {
14 /// Customization options for the flattened string output.
15 #[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
16 pub struct OutputOptions: u32 {
17 /// Default output with no extra transformations.
18 const NONE = 0;
19 /// Strip tone marks from the output.
20 const TONE_LESS = 1 << 0;
21 /// Strip diacritic marks (marks that change the vowel/consonant) from the output.
22 const MARK_LESS = 1 << 1;
23 /// Convert output to lowercase.
24 const LOWER_CASE = 1 << 2;
25 /// Return the full text including committed and active text.
26 const FULL_TEXT = 1 << 3;
27 /// Handle punctuation marks specifically for IME usage.
28 const PUNCTUATION_MODE = 1 << 4;
29 /// Reserved for future use.
30 const IN_REVERSE_ORDER = 1 << 5;
31 /// Return raw input keys instead of transformed text.
32 const RAW = 1 << 6;
33 }
34}