Coder Social home page Coder Social logo

panther99 / cyrla Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 0.0 33 KB

Library for two-way conversion between latin and cyrillic script written in Rust

Home Page: https://crates.io/crates/cyrla

License: MIT License

Rust 100.00%
cyrillic latin text-processing

cyrla's People

Contributors

panther99 avatar

Stargazers

 avatar

Watchers

 avatar

cyrla's Issues

Punctuation signs making issue when converting text

Currently, there is an issue when trying to convert text which includes punctuation signs and ignored words. For example:

#[test]
fn it_does_not_convert_ignored_latin_words() {
    let mut builder = ConverterBuilder::new();
    let mut ignored_words = vec!["C#", "C++", "R", "Python"];
    let converter = builder
        .add_ignored_latin_words(&mut ignored_words)
        .build();

    let cyrillic_text = converter.lat_to_cyr("Jezici koji se koriste na projektu su C#, C++, R i Python.");

    assert_eq!("Језици који се користе на пројекту су C#, C++, R и Python.", cyrillic_text);
}

This will fail.

---- tests::it_does_not_convert_ignored_latin_words stdout ----
thread 'tests::it_does_not_convert_ignored_latin_words' panicked at 'assertion failed: `(left == right)`
  left: `"Језици који се користе на пројекту су C#, C++, R и Python."`,
 right: `"Језици који се користе на пројекту су Ц#, Ц++, R и Пyтхон."`', src/lib.rs:139:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

It's because text is being split by spaces and converter picks up punctuation signs along with the letters.

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.