ogallagher / han_url Goto Github PK
View Code? Open in Web Editor NEWConvert between 한글 (hangul) and acii/latin urls
Convert between 한글 (hangul) and acii/latin urls
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.
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.
Manage url (and url part) mappings visit converted urls.
This will be used when the given token is not a known key for mapping to latin characters.
Ex. 녹차를 마시고 늦잠으로 들고 → nogchareul mashigo neujjameuro deulgo
// 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;
}
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]
}
}
Add new url (and url parts) mappings and reference them.
yargs
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.