Socket
Socket
Sign inDemoInstall

watson-translate-stream

Package Overview
Dependencies
115
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    watson-translate-stream

A duplex stream that detects and translates natural language using IBM Watson


Version published
Weekly downloads
1
Maintainers
1
Install size
23.7 MB
Created
Weekly downloads
 

Readme

Source

watson-translate-stream

A duplex stream that detects and translates natural language using IBM Watson.

Installation

Download node at nodejs.org and install it, if you haven't already.

npm install watson-translate-stream --save

Usage

Watson translate stream uses a duplex stream to manage two text streams between differing natural languages.

Constructor

class LanguageStream extends Stream.Transform
 constructor: (@fromLanguage, @toLanguage) ->

Snippet

LanguageFilter = require('watson-translate-stream')
Pipe = require("multipipe")

# Create a shell process to attach to.
cmd =  'telnet'
arguments = ['localhost', '3001']
process = ChildProcess.spawn(cmd, arguments)

# Make a new language filter, and set the egress stream language to
# english. In this example, we know what we are speaking (en), and
# we don't set the far end language so it can be detected and translated.
# To turn off detection, specify both ingress and egress languages.
# Supports the current Watson languages (en, es, fr, ko)
language = new LanguageFilter('en')

ingressProcessStream = Pipe(language.ingressStream, process.stdin)
egressProcessStream = Pipe(process.stdout, language.egressStream)

Dependencies

  • multipipe: pipe streams with centralized error handling
  • watson-developer-cloud: Client library to use the IBM Watson Services and AlchemyAPI

Dev Dependencies

License

MIT

Generated by package-json-to-readme

Keywords

FAQs

Last updated on 10 Feb 2016

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc