Coder Social home page Coder Social logo

sublimetranslit's Introduction

SublimeTranslit

build

SublimeTranslit is a plugin for Sublime Text 3 (http://www.sublimetext.com/3) for transliterating selected text.

Intented to be used via Command Palette.

Install

Install using Package Control: Translit

Usage

Open Command Palette and type "translit" to see several options.

Creating Transliteration Dictionaries

SublimeTranslit supports extending it with additional dictionaries.

Every Dictionary is described by two files:

  1. dictionary_name.json - is used to define characters mapping.
  2. dictionary_name.sublime-commands - is used to add a command for this dictionary to Command Palette.

dictionary_name.dict

Contains mapping (dictionary "chars_mapping") of characters.

All other fields (name, description, link) is optional and specified in order to explain used translit rules and point to source documents.

dictionary_name.sublime-commands

It is a ordinary .sublime-commands file for Command Palette item for this dictionary.

Should run command transliterate_selection with parameter dictionary_file - a file name of dictionary_name.json (without path).

Example:

[
    {
        "caption": "<command name>",
        "command": "transliterate_selection", "args":
        {
            "dictionary_file": "dictionary_name.json",
            "invert_mapping": false
        }
    }
]

invert_mapping field will trigger inverting of mapping from JSON file which is useful to use one mapping file to define two transliterations (both sides).

Run unittests

Using pytest:

$ pytest

sublimetranslit's People

Contributors

ava57r avatar malexer avatar michfield avatar xt99 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

sublimetranslit's Issues

Can this amazing tool be packaged for Atom?

A simple question, I hope: I have the need to use Atom text editor, and I would be very happy to have this tool available in Atom as well. How simple (or complex) would it be to create an Atom package with the same functionality?

Not Working, ST3 3126

Traceback (most recent call last):
File "/opt/sublime_text/sublime_plugin.py", line 812, in run_
return self.run(edit, **args)
TypeError: run() missing 1 required positional argument: 'invert_mapping'

Not able to transliterate digraphs.

Hi @malexer

I can't seem to make this package work with digraphs. I've created two dictionaries, to convert from Croatian (Latin) to Serbian (Cyrillic) and vice versa, from Serbian to Croatian. In each of them there are three specific points involving digraphs:

# Croatian to Serbian
(LJ|Lj) -> Љ / lj -> љ
(NJ|Nj) -> Њ / nj -> њ
(DŽ|Dž) -> Џ / dž -> џ

# Serbian to Croatian
Љ -> Lj / љ -> lj
Њ -> Nj / њ -> nj
Џ -> Dž / џ -> dž

Now, converting from Serbian to Croatian works as expected (for instance, љ is always correctly substituted with lj). However, the opposite direction never works (lj will always get substituted with лј, which is wrong).

For reference, here are all my dictionaries' files:

Can you please help me find a solution?

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.