Code Monkey home page Code Monkey logo

translate's Introduction

Translate

This project about makes translator among Indonesia, English, Japan, and Ngapak using Google Translator API and Local data which collect by our team for Ngapak Language. this project purpose to Artificial Intelligence programme

Library

csv

this project need csv library for read datalang.csv to fetch data and restored to array import

import csv

usage

import csv

id = [] # variable for restored csv index 0 or Indonesia Language
ng = [] # variable for restored csv index 1 or Ngapak Language

with open('datalang.csv') as csvDataFile:
    csvReader = csv.reader(csvDataFile)
    for row in csvReader:
        id.append(row[0])
        ng.append(row[1])

Translator

this library for translate to other language using API import

from translate import Translator

usage

translate to target destination language using key to_lang with default language is English en

from translate import Translator
engTrans = Translator(to_lang="id")
try:
    engTxt = engTrans.translate("Hello World!")
    print(engTxt)
except:
    print("Please try again...")

or to more specific language using 2 digit language code or ISO 639-1 codes, you can find out more language code here ISO 639-1

from translate import Translator
engTrans = Translator(from_lang="id", to_lang="en")
try:
    engTxt = engTrans.translate("Halo Dunia!")
    print(engTxt)
except:
    print("Please try again...")

Contribution

if you wonder how can I contribute to this project, you can clone and contribute Ngapak Language by fill up our vocabulary called datalang.csv on test package or

Data Ngapak - Indonesia Language

Data Language: datalang.csv

datalang.csv

You can contribute to test our code using Python as the main language.

Indonesia - Ngapak Test : IndoNgapakTrans.py

Fully Test : TestTranslate.py

translate's People

Contributors

derysudrajat avatar

Watchers

James Cloos avatar

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.