Code Monkey home page Code Monkey logo

han_url's People

Contributors

ogallagher avatar

Watchers

 avatar

han_url's Issues

Support url queries and anchors

The url convert method currently only supports subdomain, domain, top level domain, and path parts. Urls can also contain an anchor and url query parameters.

Method to generate suggested latin phonetic from hangul string

This will be used when the given token is not a known key for mapping to latin characters.

Ex. 녹차를 마시고 늦잠으로 들고 → nogchareul mashigo neujjameuro deulgo

References

https://github.com/Kagami/hangeul.js/blob/83cd645886d7294990e3a0065aff63213518b476/index.js#L455-L473

// Convert hangul to jamos.
function disassemble(hangul) {
  const chars = [];
  for (let i = 0; i < hangul.length; i++) {
    let n = hangul.charCodeAt(i);
    if (n >= 44032 && n <= 55203) {
      n -= 44032;
      const j1 = Math.floor(n / 588);
      n -= j1 * 588;
      const j2 = Math.floor(n / 28);
      const j3 = n - j2 * 28;
      chars.push([JAMO[0][j1], JAMO[1][j2], JAMO[2][j3]]);
    } else {
      // Non hangul character.
      return null;
    }
  }
  return chars;
}

https://github.com/kawoou/jquery-korean-pron/blob/1c84ecb940e9fc558e314687bf2e37a4419c811d/src/jquery.korean-pron.js#L32-L52

var isHangul = function (code) {
    return 0xAC00 <= code && code <= 0xd7a3
}

var output = ''

var code
var length = input.length
for (var i = 0; i < length; ++ i) {
    code = input.charCodeAt(i)

    if (isHangul(code)) {
        var newCode = code - 0xAC00
        var jong = newCode % 28
        var jung = (newCode - jong) / 28 % 21
        var cho = parseInt((newCode - jong) / 28 / 21)
        output += CHO[cho] + JUNG[jung] + JONG[jong]
    } else {
        output += input[i]
    }
}

Deploy to basic chrome extension

The extension will have an interface to manage url part mappings, as well as a search bar for converting and navigating to hangul aliased urls.

Example demo cli driver

Add new url (and url parts) mappings and reference them.

  • handle cli args with yargs
  • load data on start
  • display current data
  • convert han url input to latin url
  • add new mappings for each url part
  • save data on end

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.