Git Product home page Git Product logo

Comments (2)

tom-lord avatar tom-lord commented on May 31, 2024

Notes to self, after a little more research --

Ruby already directly references the Unicode RFC. For example, for the \p{In Miscellaneous Mathematical Symbols-B} example above, we have: https://github.com/ruby/ruby/blob/3628eae2e754a7489feebc6f41371d42d2efcf3c/enc/unicode/11.0.0/name2ctype.h#L34478-L34482

Then, there is this tool in the ruby source code to parse and map property names according to the unicode docs: https://github.com/ruby/ruby/blob/7aaf5b2878210d4df03a84be8d514a553839a5ba/tool/enc-unicode.rb and a template for decomposing the properties: https://github.com/ruby/ruby/blob/4444025d16ae1a586eee6a0ac9bdd09e33833f3c/template/unicode_norm_gen.tmpl.

Lastly, note that ruby defines its unicode version here. And, due to this, we can access it at runtime via: RbConfig::CONFIG['UNICODE_VERSION'].


So in conclusion, I believe it should be possible to access ruby's unicode mappings which are built at compilation; probably with a native C extension. Failing that, the above code should provide enough hints to reproduce the mapping generation as part of the gem installation process if necessary.

Either way, this solution would be far superior to the current db/ folder implementation.

from regexp-examples.

Related Issues (17)

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.