Git Product home page Git Product logo

vi-rs's Introduction

VI

Cargo Crate Docs License

A input method library for Vietnamese input engine written completely in Rust

What is this?

Since typing Vietnamese on Linux is pretty painful at the momment, a better input engine is always needed. To accommodate the future engines that will be built in Rust, this library existed to transform key inputs into the Vietnamese string output.

If you wish to find out how it works, I have written a short blog post (in Vietnamese) on how the library place a tone mark when it received the user input. Read it here.

Installation

Add vi to your dependencies in Cargo.toml.

[dependencies]
vi = "0.3.6"

Examples

With vi, you can start building your own Vietnamese IME without worrying about how Vietnamese tone mark placement works. All you have to do is to implement a keyboard listener & a key sending system.

extern crate vi;

use vi::vni;

fn main() {
    let inputs = vec![
        vec!['v', 'i', 'e', 't', '6', '5'],
        vec!['n', 'a', 'm']
    ];

    let mut result = String::new();
    for input in inputs {
        vni::transform_buffer(input.iter().cloned(), &mut result);
        result.push(' ');
    }
    
    println!("{}", result); // prints "việt nam "
}

Please refer to the examples/ directory to learn more.

Support

  • VNI
  • Telex

Project status

Currently, this project is still at its early stage of development. There might be some minor bugs but overall, it should be 95% functional.

Creator

Want to support me? Consider buying me a coffee:)

ko-fi

vi-rs's People

Contributors

zerox-dg avatar unrealhoang avatar huytd avatar quangio avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.