⌨️ 타자번역
Mora Api 타자번역 입니다.
타자번역
출처 : https://npmjs.com/package/inko
Templates
API는 모두 GET 메서드를 사용합니다
영어 타자 → 한글 타자
GET
https://mora-bot.kr/api/v1/en2ko?text={한글 타자로 변환할 문장}
Query Parameters
Name
Type
Description
text*
String
한글 타자로 변환할 문장
// 응답 내용
{
"license": "inko module used https://www.npmjs.com/package/inko",
"status": 200,
"origin": "ahfk",
"result": "모라",
"success": true
}
Field
Type
Description
origin
String
호출된 문장
result
String
변환된 문장
NodeJS
// node-fetch
const fetch = require('node-fetch')
fetch(`https://mora-bot.kr/api/v1/en2ko?text=${encodeURI(`택스트`)}`)
.then(res => res.json())
.then(json => {
console.log(json)
console.log(`입력된 값 : ${json.origin}`);
console.log(`한글 타자로 : ${json.result}`);
});
// request
let api_url = `https://mora-bot.kr/api/v1/en2ko?text=${encodeURI(`텍스트`)}`
const request = require('request');
let options = {
url: api_url
}
request.get(options, function (error, response, body) {
if (!error && response.status == 200) {
let json = JSON.parse(body)
console.log(`입력된 값 : ${json.origin}`);
console.log(`한글 타자로 : ${json.result}`);
} else {
console.log('error = ' + response.errorcode);
}
});
Python
import requests
response = requests.get("http://mora-bot.kr/api/v1/en2ko?text=[텍스트]")
result = response.json()
if response.status == 200:
print(result)
else:
print(f"Error Code: {response.errorcode}")
한글 발음 → 영어 발음
GET URL : https://mora-bot.kr/api/v1/ko2en?text={영어 타자로 변환할 문장}
Field
Type
Description
origin
String
호출된 문장
result
String
변환된 문장
// 응답 내용
{
"license":"inko module used https://www.npmjs.com/package/inko",
"status":200,
"origin":"모라",
"result":"ahfk",
"success":true
}
NodeJS
// node-fetch
const fetch = require('node-fetch')
fetch(`https://mora-bot.kr/api/v1/ko2en?text=${encodeURI(`텍스트`)}`)
.then(res => res.json())
.then(json => {
console.log(json
console.log(`입력된 값 : ${json.origin}`);
console.log(`한글 타자로 : ${json.result}`);
});
// request
let api_url = `https://mora-bot.kr/api/v1/ko2en?text=${encodeURI(`텍스트`)}`
const request = require('request');
let options = {
url: api_url
}
request.get(options, function (error, response, body) {
if (!error && response.status == 200) {
let json = JSON.parse(body)
console.log(`입력된 값 : ${json.origin}`);
console.log(`한글 타자로 : ${json.result}`);
} else {
console.log('error = ' + response.errorcode);
}
});
Python
import requests
response = requests.get("https://mora-bot.kr/api/v1/ko2en?text=[텍스트]")
result = response.json()
if response.status == 200:
print(result)
else:
print(f"Error Code: {response.errorcode}")
Last updated
Was this helpful?