8000 GitHub - sarahrainbow/translate-data
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

sarahrainbow/translate-data

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Translate Data API

An API that takes an input of translated scripts (array of strings) and outputs formatted JSON data.

The API detects and separates out the data into:

  • Metadata
  • English
  • Persian

For example, this input data:

["This is very futuristic.""DAVE:", " این خیلی آینده‌نگرانه Ø
733B
§Ø³Øª..", "Yes", "MARCIE MILLER:", "بله "]

Would output:

{
    "script": [
        {
            "english": "This is very futuristic.",
            "meta": "DAVE",
            "farsi": " این خیلی آینده‌نگرانه است.."
        },
        {
            "english": "Yes",
            "meta": "MARCIE MILLER",
            "farsi": " بله "
        }
    ]
}

Setup

Clone this repo by running:

git clone git@github.com:sarahrainbow/translate-data.git
cd translate-data

Install dependencies by running:

npm install

Make a Request

POST /translate

Request body: array of strings e.g.

["This is very futuristic.""DAVE:", " این خیلی آینده‌نگرانه است.."]

Local Development

To install the dependencies run

npm i

To run development environment on localhost:8080

npm start

Using an API testing tool (e.g. Postman) make a POST request with the input json data in the Body field with the route http://localhost:8080/translate

screenshot of post example

On SEND this should yield the converted output in the same format as the following example:

{
    "script": [
        {
            "english": "This is very futuristic.",
            "meta": "DAVE",
            "farsi": " این خیلی آینده‌نگرانه است.."
        },
        {
            "english": "Yes",
            "meta": "MARCIE MILLER",
            "farsi": " بله "
        }
    ]
}

Testing

To run the tests:

npm run test

Want more?

See documentation here.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0