Giter Club home page Giter Club logo

transliteration's People

Contributors

amake avatar barwin avatar dependabot[bot] avatar dremora avatar dzcpy avatar greenkeeper[bot] avatar koopero avatar leopoldthecoder avatar linkfly6 avatar ogonkov avatar pskordilakis avatar renovate-bot avatar segeda avatar waldyrious avatar zobzn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

transliteration's Issues

This is a romanization library

Hi,

Cool library. But isn’t it more accurate to call it a romanization library than a transliteration library? The term transliteration doesn’t assume a roman-alphabet output.

Does not work inside web workers

Importing the transliteration module in the context of a Web Worker does not work as expected.

  self.importScripts('/js/libs/transliteration.min.js');
  var t = transl("This line throws error");

I believe this has to do with the fact that there is no window object defined in the web worker context.

chinese vs japanese

Thanks for making this node module, it looks pretty neat, I've been looking for a separate transliterator, one that's not a web service, for a while now.

I'm trying to transliterate '古代祐三' to Yuzo Koshiro or Koshiroyūzō or at least koshiroyuzo, however, I'm getting the chinese transliteration:

> tr('古代祐三'); // Yuzo Koshiro, google translate gives Koshiroyūzō
'Gu Dai You San'
> tr('鈴木さると'); // Saruto Suzuki, google translate gives Suzuki saru to
'Ling Mu saruto'

Is there a way to prefer japanese over chinese?
Thanks!

An in-range update of browserify is breaking the build 🚨

Version 14.3.0 of browserify just got published.

Branch Build failing 🚨
Dependency browserify
Current Version 14.2.0
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As browserify is “only” a devDependency of this project it might not break production or downstream projects, but “only” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this 💪


Status Details
  • continuous-integration/travis-ci/push The Travis CI build could not complete due to an error Details
Commits

The new version differs by 4 commits .

  • cd01926 14.3.0
  • 08caf04 changelog
  • ad5060d Merge pull request #1710 from substack/https-browserify-1
  • 7c7b4d4 update https-browserify to ^1.0.0

See the full diff.

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

Uncaught TypeError: Object(...) is not a function

In any v2 version I'm getting:

Uncaught TypeError: Object(...) is not a function

With this simple example:

import { transliterate } from 'transliteration';
console.log(transliterate('bla bla'));

no issues in 1.6.6

An in-range update of nyc is breaking the build 🚨

Version 10.2.0 of nyc just got published.

Branch Build failing 🚨
Dependency nyc
Current Version 10.1.2
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As nyc is “only” a devDependency of this project it might not break production or downstream projects, but “only” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this 💪


Status Details
  • continuous-integration/travis-ci/push The Travis CI build could not complete due to an error Details
Commits

The new version differs by 6 commits .

  • 455619f chore(release): 10.2.0
  • 95cc09a feat: upgrade to version of yargs with extend support (#541)
  • 43535f9 chore: explicit update of istanbuljs dependencies (#535)
  • 98ebdff feat: allow babel cache to be enabled (#517)
  • 50adde4 feat: exclude the coverage/ folder by default 🚀 (#502)
  • 6a59834 chore(package): update tap to version 10.0.0 (#507)

See the full diff.

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

Some characters are not transliterated

Thanks for your library. I use it to send SMS about servers crash, and I found that sms delivered with longer that it should. It happened, because some characters not converted from UTF-8 to proper ASCII. Here is my fix in wrapper around your library.

image

Please submit, is it an issue with your library?

RequireJS support

Hello, I've been trying to use transliteration in browser via RequireJS but to no avail.

When I inspected the dist/browser/transliteration.js, I found out that the CommonJS support just doesn't do the job. On the other hand, when I tried adding

define(function(require, module, exports) {
        return {
            transliterate: _.transliterate,
            slugify: _.slugify
        }
    });

after line 223, RequireJS was able to give me what I needed.

Is it possible to check if this approach doesn't break anything and add it to production?

‘browser’ breaks ‘main’ using Browserify and broken ember-cli

I’m using transliteration with ember-browserify and it loads lib/browser instead of lib/node generating an ./x0.json not found error. This started to happen after upgrading transliteration to 1.5.x from 1.2.x.

I’m new to these toos so this is what I found: Browserify uses browser as alternative to main entry when reading package.json. So it’s probably what causes it to load the wrong version.

It should be possible to change the main entry point by other means but it looks like ember-cli doesn’t like non-default main.

So, is transliteration stepping over browserify’s toe reusing the ‘browser’ attribute; is it something usual; or is it me that am using inadequate tools and don’t know how to config it right?

PS: For now I’m downgrading, but it’s easy to fix 1.5.2 by renaming ‘browser’ to something else. Also it could be possible to write a index.js file at root level or some other voodoo.

An in-range update of eslint-config-airbnb-base is breaking the build 🚨

Version 11.1.1 of eslint-config-airbnb-base just got published.

Branch Build failing 🚨
Dependency eslint-config-airbnb-base
Current Version 11.1.0
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As eslint-config-airbnb-base is “only” a devDependency of this project it might not break production or downstream projects, but “only” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this 💪


Status Details
  • continuous-integration/travis-ci/push The Travis CI build could not complete due to an error Details
Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

Separate function and data

T13n - is array of character pairs only, organized by manual or local t13n standards (character mappings/pairs). Some need only tool for converting strings by they own standart, some need pair collections to use in their own software.

I think, we need to seporate tool from data (character pairs).

An in-range update of gulp-uglify is breaking the build 🚨

Version 2.1.2 of gulp-uglify just got published.

Branch Build failing 🚨
Dependency gulp-uglify
Current Version 2.1.1
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As gulp-uglify is “only” a devDependency of this project it might not break production or downstream projects, but “only” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this 💪


Status Details
  • continuous-integration/travis-ci/push The Travis CI build could not complete due to an error Details
Release Notes v2.1.2

Bug Fixes

  • package: In the previous release devDependencies were incorrectly added as dependencies. This moves them to the correct location. (ba83a45c)
Commits

The new version differs by 2 commits .

See the full diff.

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

CLI doesnt work

Hi, I have problem with CLI version

_npm install --save transliteration_

slugify "Štandardy pre informačné systémy verejnej správy"

module.js:457
    throw err;
    ^

Error: Cannot find module '../../build/node/utils'
    at Function.Module._resolveFilename (module.js:455:15)
    at Function.Module._load (module.js:403:25)
    at Module.require (module.js:483:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/Users/pmelisko/Documents/workspace/init/node_modules/transliteration/lib/bin/slugify:8:14)
    at Module._compile (module.js:556:32)
    at Object.Module._extensions..js (module.js:565:10)
    at Module.load (module.js:473:32)
    at tryModuleLoad (module.js:432:12)
    at Function.Module._load (module.js:424:3)

build folder doesn't exist
after fixing of requires to proper paths in lib/bin/slugify (similarly in lib/bin/transliterate) it will work

var _utils = require('../../build/node/utils'); -> var _utils = require('../node/utils');
var _slugify = require('../../build/node/slugify'); -> var _slugify = require('../node/slugify');
_slugify "Štandardy pre informačné systémy verejnej správy"_
standardy-pre-informacne-systemy-verejnej-spravy

PS: is there any possibility to read input from stdin? something like:
$ echo "Štandardy pre informačné systémy verejnej správy" | slugify
Invalid argument. Please type 'node_modules/.bin/slugify --help' for help.
undefined

An in-range update of eslint-config-airbnb-base is breaking the build 🚨

Version 11.1.3 of eslint-config-airbnb-base just got published.

Branch Build failing 🚨
Dependency eslint-config-airbnb-base
Current Version 11.1.2
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As eslint-config-airbnb-base is “only” a devDependency of this project it might not break production or downstream projects, but “only” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this 💪


Status Details
  • continuous-integration/travis-ci/push The Travis CI build could not complete due to an error Details
Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

关于中文和日文汉字问题

我在想,是否可以提供一个语言偏好的options来确定,返回的注音结果应该用中文还是日语还是韩语
毕竟中日韩文字混合在一起出现的情况无论如何也无法识别,一般情况下肯定只是其中一种

Bower build is broken

The build that has been uploaded to Bower appears to be completely broken. When I download it and install it according to the documentation, I get an error that require is undefined. It seems like the node.js version may have been uploaded instead of the Bower version.

Also, it appears that that the regular JS file is minified - all of the code is on a single line.

Also, it appears that the bower version 0.1.1 for this library has completely disappeared, which has prevented us from reverting to an old version without manually embedding the library into our own source code.

Several things appears to be wrong with the bower build.

Issue running with React Native

Using React Native, the module crashes when called, only when hot reloading is disabled. When hot reloading is enabled then it works.

error TypeError: babelHelpers.typeof is not a function
    at mergeOptions
    at transliterate

The raw Babel transpiled code looks like this:

if(key==='replace'&&babelHelpers.typeof(result[key])==='object'&&!(result[key]instanceof Array)){

I'm including transliterate as follows

import { transliterate } from 'transliteration/src/main/browser';

I notice that transliteration/lib/node/utils.js uses a custom typeOf to avoid the problem, but for some reason it's trying to use transliteration/src/main/utils.js that has babel replace the typeof operator with it's own.

Mistake in README.md

var slug = tr.slugify;
var tr = transliteration.transliterate

'tr' was used before it was defined.

Please fix
var transliteration = require('transliteration'),
tr = transliteration.transliterate,
slugify = transliteration.slugify;

An in-range update of coveralls is breaking the build 🚨

Version 2.12.0 of coveralls just got published.

Branch Build failing 🚨
Dependency coveralls
Current Version 2.11.16
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As coveralls is “only” a devDependency of this project it might not break production or downstream projects, but “only” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this 💪


Status Details
  • continuous-integration/travis-ci/push The Travis CI build could not complete due to an error Details
Release Notes Branch coverage support

Adds branch coverage data to Coveralls API post.

Commits

The new version differs by 2 commits .

See the full diff.

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

An in-range update of eslint-config-airbnb-base is breaking the build 🚨

Version 11.1.2 of eslint-config-airbnb-base just got published.

Branch Build failing 🚨
Dependency eslint-config-airbnb-base
Current Version 11.1.1
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As eslint-config-airbnb-base is “only” a devDependency of this project it might not break production or downstream projects, but “only” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this 💪


Status Details
  • continuous-integration/travis-ci/push The Travis CI build could not complete due to an error Details
Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

Error in Iphone 6 plus

Hello,
Thank you! Your module works perfect for me, but one of our clients has an error when I use your module on my website.
Here is a screenshot of that error
photo_2018-09-14_14-22-22
He has an error in safari and chrome, so now he can't use my website.
I can't reproduce the error with my devices, but I'm afraid that other users have the same errors.

Problems when ignoring the Ø character

Problem
Spaces before the Ø character are removed

Expected Output
Twenty Øne Piløts

Actual Output
TwentyØne Pilots

Version
1.3.0, in the transliteration demo

1.6.1version

/Users/yuri/work/vue-beauty/node_modules/transliteration/data/index.js:1
(function (exports, require, module, __filename, __dirname) { import charmap from './charmap.json';
                                                        
SyntaxError: Unexpected token import
   at createScript (vm.js:53:10)
    at Object.runInThisContext (vm.js:95:10)
    at Module._compile (module.js:543:28)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/Users/yuri/work/vue-
    beauty/node_modules/transliteration/lib/node/transliterate.js:10:13)

version 1.5.4 is ok

Transliterate Removal of Symbols

I am trying to transliterate ®, ©, ', and ™ into blank characters meaning completely removing them when they are slugified.

The following is what I tried to do:

var tr = require('transliteration');
var slugify = require('transliteration').slugify;

// replacement attempt
tr("0xAE, 0xFEFF"); // ®
tr("0xA9, 0xFEFF"); // ©
tr("0x2122, 0xFEFF"); // ™

slugify(name, { lowercase: true })

For example, when I use slugify on a name like "ABC®: 123", it transliterates to:
abc-r-123

However, I want the resulting name to be like:
abc-123

Not working for Thai

Completely broken for Thai.

Try เชียงใหม่

Should​ be Chiang Mai. Official scheme for Thai is RTGS.

Your transliteration looks as broken as ICU.

Version 1.5.3 'leaks' ES6 code (let, const) into minified js bundle when built

I've got an issue that seems related to #28

I've got a meteor app (meteor controls the build) that imports transliteration - there's a description of the problem and a reproduction based on our app here: reactioncommerce/reaction#2091

For versions up to 1.5.2 transliteration bundles a correctly babelified and minified js file. When we got bumped up to 1.5.3, we started seeing let and const in our minified production bundle. I think this is due to the change for 1.5.3 that removed the "browser": "lib/browser/transliteration.js", line, and the conversation in #28 seems to point that direction as well.

This issue only causes problems for us when an older browser such as PhantomJS is used to crawl the site. Unfortunately, the prerendering techniques we use to create cached, google/bing/yahoo crawl friendly pages use PhantomJS, and the let and const in the js bundle causes them to crash before rendering.

Version 10 of node.js has been released

Version 10 of Node.js (code name Dubnium) has been released! 🎊

To see what happens to your code in Node.js 10, Greenkeeper has created a branch with the following changes:

  • Added the new Node.js version to your .travis.yml
  • The new Node.js version is in-range for the engines in 1 of your package.json files, so that was left alone

If you’re interested in upgrading this repo to Node.js 10, you can open a PR with these changes. Please note that this issue is just intended as a friendly reminder and the PR as a possible starting point for getting your code running on Node.js 10.

More information on this issue

Greenkeeper has checked the engines key in any package.json file, the .nvmrc file, and the .travis.yml file, if present.

  • engines was only updated if it defined a single version, not a range.
  • .nvmrc was updated to Node.js 10
  • .travis.yml was only changed if there was a root-level node_js that didn’t already include Node.js 10, such as node or lts/*. In this case, the new version was appended to the list. We didn’t touch job or matrix configurations because these tend to be quite specific and complex, and it’s difficult to infer what the intentions were.

For many simpler .travis.yml configurations, this PR should suffice as-is, but depending on what you’re doing it may require additional work or may not be applicable at all. We’re also aware that you may have good reasons to not update to Node.js 10, which is why this was sent as an issue and not a pull request. Feel free to delete it without comment, I’m a humble robot and won’t feel rejected 🤖


FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Add Additional Filter

I was wondering if there is some way to add additional filters (specifically non visible ASCII character (backspace, etc)?

Angular Support

Can you make this compatible with Angular and/or show us how to use it in Angular with TypeScript?

add an option to ignore currencies

transliterate('€', {
  unknown: ''
})

Produces:

PS

Expected that transliterate would strip currency characters when used with transliterate(input, { unknown: '' }) setting.

Issue with UglifyJS while packing production build

Hello,

I have no problem using transliterate in my dev environment, however, when I try to generate my production build I get an error with webpack 2 UglifyJS plugin complaining about codemap:

ERROR in /app-1b68d4b985561a4f9537.js from UglifyJs
SyntaxError: Unexpected token: name (codemap) [/app-1b68d4b985561a4f9537.js:4079,4]

I'm using react (es6) and I'm importing the transliterate helper via:
import {transliterate} from 'transliteration/src/main';

I couldn't get any other method described in the README for the import to work.

Using node v7.4.0 (with npm v4.1.2)

Is there something I'm missing? Eagerly waiting for you insights ^^

Support for React Native

I am trying to include transliteration in my React Native app. I am having difficulties because the transliterate.js filedoes dynamic module loading:

codemap[offset] = require('../../data/x' + offset.toString(16) + '.json');

This fails in React Native because the RN packager does not support dynamic module loading.

Is there any hope of using this package on React Native? Is there an easy way to bundle up all required assets (including all the JSON files that are dynamically required) perhaps and add a RN version?

Thanks for any thoughts you have!

ISO-9 Cyrilic Table1, Table2, Table3

ISO-9 (ru) for Cyrilic languages have at least 3 variants of translitiration.
To resolve this problem we can pass to the translation function argument with standard string, for example ISO-9.Table1.ru or ISO-9.Table1.uk

Global variable leak

Hi,

strNew in lib/transliteration.js is leaking to the global scope (a var is missing at line 32).

Cheers

Feature: Built-in Support for Yandex Rules for Cyrillic

I don't like the transliteration rules used for Cyrillic and want to use Yandex rules (for names, on the map, etc.) instead (Yandex.Money also have rules for credit cards, just in case).
One solution to my problem is to use replace config, but in #57 @andyhu states:

...using 'replace' option to do it seems not an ideal solution. Because it uses a global regex replace. If there are many replaces and the text is very long, considering it's not implement as an async function, it may freeze the node process.

So I guess better solution would be to support Yandex rules out of the box and in this issue I ask for this.
I would write a patch myself, but considering you plan some drastic changes for 2.0, I don't do this.
Let me know if I may help you implementing Yandex rules support.

Thanks.

UPD

What is the source for current transliteration rules for Cyrillic in charmap.json? Was it built with Google Transliteration API or other way?

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.