Giter Site home page Giter Site logo

kbatsuren / wiktra Goto Github PK

View Code? Open in Web Editor NEW
27.0 5.0 5.0 1.89 MB

Wiktra - Python tool of Wiktionary Transliteration modules for 514 languages and its 102 different scripts (orthographies)

License: GNU General Public License v2.0

Python 0.97% Lua 98.61% PHP 0.39% Shell 0.03%
python transliteration transliterator wiktionary wiktionary-tool korean-transliteration arabic-transliteration hindi-tranliteration bengali-transliteration russian-transliteration

wiktra's Issues

missing file wikt.mw

lupa._lupa.LuaError: [string ""]:1: module 'wikt.mw' not found:
is raised when trying to import translite

Update to cover all Wiktionary transliterations?

How feasible would it be to update this to cover all Wiktionary transliterations, and possibly expose additional functionality?

  1. Update to cover all transliteration modules: https://en.wiktionary.org/wiki/Category:Transliteration_modules

  2. Change the API so we can specify the input ISO 639 language code and/or ISO 15924 script code, possibly only the ISO script code without specifying the language.

  3. Change the API so we can optionally specify the output language and/or script code, so we can transliterate to other scripts/languages, not just Latin, using modules like https://en.wiktionary.org/wiki/Module:Newa-Deva-translit

  4. It would be best that language and script lookups would be done using native Lua modules (see dependencies below)

  5. Provide instructions or some script that automatically updates the Lua components from Wiktionary (I don’t know how this is done).

Possible dependencies

Integrate languages:

Integrate families:

Integrate scripts:

Integrate translit-redirect/data

Dependencies:

Missing wikt.mw — another take

A simpler way to solve the missing wikt.mw problem would be to add

import os
os.chdir(os.path.dirname(__file__))

at the beginning of Wiktra.py

Missing transliteration modules

If I try to transliterate Georgian text (e.g. wiktrapy -l geo -t მხედრული), I get the following error (abbreviating somewhat):

File "lupa/_lupa.pyx", line 280, in lupa._lupa.LuaRuntime.execute
  File "lupa/_lupa.pyx", line 1297, in lupa._lupa.run_lua
  File "lupa/_lupa.pyx", line 1306, in lupa._lupa.call_lua
  File "lupa/_lupa.pyx", line 1332, in lupa._lupa.execute_lua_call
  File "lupa/_lupa.pyx", line 1268, in lupa._lupa.raise_lua_error
lupa._lupa.LuaError: [string "<python>"]:1: module 'wikt.translit.Geor-translit' not found:
	no field package.preload['wikt.translit.Geor-translit']
	no file '/var/www/.local/lib/python3.9/site-packages/wiktra/wikt/translit/Geor-translit.lua'
	no file '/var/www/.local/lib/python3.9/site-packages/wiktra/wikt/wikt/translit/Geor-translit.lua'
	no file '/var/www/.local/lib/python3.9/site-packages/wiktra/wikt/translit/wikt/translit/Geor-translit.lua'
	no file '/var/www/.local/lib/python3.9/site-packages/wiktra/wikt/data/wikt/translit/Geor-translit.lua'
	no file '/var/www/.local/lib/python3.9/site-packages/wiktra/wikt/data/translit/wikt/translit/Geor-translit.lua'
	no file '/usr/local/lib/lua/5.3/wikt/translit/Geor-translit.so'
	no file '/usr/local/lib/lua/5.3/loadall.so'
	no file './wikt/translit/Geor-translit.so'
	no file '/usr/local/lib/lua/5.3/wikt.so'
	no file '/usr/local/lib/lua/5.3/loadall.so'
	no file './wikt.so'

Arabic transliteration module incompatible with Lua ≥5.2

In line 332 of wikt/translit/ar-translit.lua, unpack(sub) should be replaced with table.unpack(sub), otherwise Lua throws the error attempt to call a nil value (global 'unpack').

This may also be an issue with other transliteration modules, but I have not checked if there are any others that use unpack.

Hebrew transliteration not working

Hebrew text does not get transliterated, regardless of whether the input is a single letter or a whole word, and regardless of whether vowel marks are used or not. E.g. wiktrapy -l heb -t בְּרֵאשִׁ֖ית produces בְּרֵאשִׁ֖ית, and wiktrapy -l heb -t ת produces ת.

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.