Giter Site home page Giter Site logo

iuliia-rb's People

Contributors

adnikiforov avatar am-kantox avatar theendcomplete avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

theendcomplete

iuliia-rb's Issues

No schemes available after gem installation

Hello!

No schemes available after gem installation.

Steps to reproduce:

gem install iuliia

irb
> require 'iuliia'
> Iuliia::Schema.available_schemas
=> []

ruby -v
ruby 3.0.2p107

Add reverse transliteration ability

There is one transliteration schema with ability to reverse transliteration: ISO 9:1995 (https://dangry.ru/iuliia/#unambiguous)

That's the plan:

  • Add ability to mark certain schemas as 'reversible' (probably yaml config, schemas maintainer does not provide such info)
  • Add ability to reverse transliteration (basically pass Cyrillic string to .translit and get Latin string back)
  • Add specs for this implementation

Add alias translit -> translate

Seems like most of the iuliia libraries for the other languages implements translate method instead of translit. I believe it's a good idea to make an alias and make old method deprecated.

Also readme changes required as well.

Make schemas folder a submodule

You might want to make lib/schemas folder a git submodule pointing to https://github.com/nalgeon/iuliia repo. This will make it easier to keep schemas up to date.

If you consider doing so:

  1. Delete existing schemas folder and commit.
  2. Re-add it as submodule:
git submodule add https://github.com/nalgeon/iuliia lib/schemas
  1. Commit and push.

Add polite handing of unknown schema

Right now it looks like that:

2.6.6 :002 > Iuliia::Schema['mvd']
Traceback (most recent call last):
        7: from bin/console:15:in `<main>'
        6: from (irb):2
        5: from (irb):2:in `rescue in irb_binding'
        4: from /Users/user/RubymineProjects/iuliia-rb/lib/iuliia/schema.rb:11:in `[]'
        3: from /Users/user/RubymineProjects/iuliia-rb/lib/iuliia/schema.rb:25:in `block in schemas'
        2: from /Users/user/RubymineProjects/iuliia-rb/lib/iuliia/schema.rb:29:in `load_schema'
        1: from /Users/user/RubymineProjects/iuliia-rb/lib/iuliia/schema.rb:29:in `read'
Errno::ENOENT (No such file or directory @ rb_sysopen - lib/schemas/mvd.json)

Better if we will return more polite and understandable error.

Latin letters removed from the source string

Hello!

If the source string contains latin letter such letters will disappear from the result.

Iuliia.translate("ibm pc — первый массовый персональный компьютер", schema: 'icao_doc_9303')
=> "  — pervyi massovyi personalnyi kompiuter"

Python library doesn't remove latin letters https://github.com/nalgeon/iuliia-py

iuliia.translate("IBM PC — первый массовый персональный компьютер", schema=iuliia.ICAO_DOC_9303)

'IBM PC — pervyi massovyi personalnyi kompiuter'

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.