Expand description
A Vietnamese typing composition engine.
VI implement support for Vietnamese text composition using the two most common methods: Telex and VNI.
The two main methods of this library is telex::transform_buffer
and vni::transform_buffer
but
a range of useful utility methods and constants for Vietnamese text manipulation are also exposed.
§Aspirations
- Minimal to zero configuration. The engine should have a default configurations that fit with most usecases.
- Support all transformation behaviours & orders. Adding a tonemark during or after typing a word should just work.
- Be as fast as possible.
- Be as simple as possible.
§Example
let inputs = vec![vec!['v', 'i', 'e', 't', '5', '6'], vec!['n', 'a', 'm']];
let mut result = String::new();
for input in inputs {
vi::transform_buffer(&vi::VNI, input.iter().cloned(), &mut result);
result.push(' ');
}
println!("{}", result); // prints "việt nam "
§Rules
VI aims to be as lean as possible, focusing on only the useful features and main use-cases. Therefore, the engine implemented these rules by default with no way of configuring them:
- Tone mark are placed in the new accent:
hoà
instead ofhòa
w
in telex will insertư
: sochuw
orchw
will producechư
Although, should you need to customise any behaviour, you can create your custom typing methods. See: methods
.
Re-exports§
pub use methods::*;
Modules§
- Functions used for character editing.
- Static character mappings for transformation.
- The definitions of different typing methods.
- Parser for parsing an input string as a Vietnamese word
- The core of the engine, where all the transformation algorithms lives.
- telexDeprecated
- Useful utilties functions that might be helpful for developing a Vietnamese IME.
- Validation functions for verifying if a word is a valid vietnamese word.
- vniDeprecated
- The cache for word transformation.