Giter Site home page Giter Site logo

unicorndecode's Introduction

unicorndecode

Build Status Coverage Status

unicorndecode is a port of the Text::Unicode perl library into lua. It attempts to take unicode characters and represent them in ASCII. It does this by removing accents or transliterating other languages into Roman characters - which can occasionally work well and sometimes not so well!

Installing

unicorndecode is installed via luarocks: It works out of the box with Lua 5.2/5.3, LuaJIT 2.0/2.1 and will work with Lua 5.1 if luabitop is installed.

luarocks install unicorndecode

Unidecoding

decodedString, isUTF8 = unicorndecode.decode(string)

The decode function takes in a string and returns the unidecoded version of that string and whether the string includes utf8 characters or not.

Example unidecode:

local unicorndecode = require('unicorndecode')
decodedString, isUTF8 = unicorndecode.decode('Brontë')

In this case, decodedString is Bronte and isUTF8 is true.

Quick Notes

  • The unidecode data comes from the perl Text::Unidecode library. As such, this library has all of the same caveats that Text::Unidecode does. It would be a good idea to read that page to understand when unicorndecode should be used.
  • The unidecode_data.lua table is created from the JSON file generated in UnicodeConverter passed through misc_scripts/convert_json_to_lua_table.lua.

License

This library is released under the MIT License

unicorndecode's People

Contributors

fouriertransformer avatar python1320 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

python1320

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.