0.1.1 • Published 4 months ago

papago-translate v0.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
4 months ago

About

Papago-translate is an efficient easy-to-use translator using Naver Papago.

  • Quick to learn
  • Highly maintained and Great support
  • Detailed documentation

Installation

Node.js 16.11.x or higher is recommended.
(Made on Node.js v18.10.0)

npm i discord.js

Example Usage

Importing library

const { Papago } = require("papago-translate");
const client = new Papago();

Example: Translate from Korean to English:

client.translate({
    from: "ko",
    to: "en",
    text: "빈민가에 사는 쓸모없는 골칫덩이, 그라티아."
}).then((response) => {
    console.log(response.result.translation);
}).catch(console.error);
// -> Gratia, a useless nuisance living in a slum.

Example: Detect Language of the text:

client.detectLanguage("빈민가에 사는 쓸모없는 골칫덩이, 그라티아.")
.then(console.log).catch(console.error);
// -> { error: false, result: "ko", valid: true }

Example: Get information about single word or multiple words.

client.define({
    from: "ko",
    to: "en",
    text: "줄거리"
}).then(console.log).catch(console.error);
// -> { error: false, result: { is_word: true, examples: [...], items: [ {...} ] } };

client.define({
    from: "en",
    to: "ko",
    text: "Organic Plot"
}).then(console.log).catch(console.error);
// -> { error: false, result: { is_word: false, examples: [], items: [ {...}, {...} ] } }

Documentation

You can find documentation here!

For any issue or contribution, please check the GitHub repository here!

0.1.1

4 months ago

0.1.0

4 months ago

0.0.1

4 months ago