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: ->
Snippet
LanguageFilter = requirePipe = require # Create a shell process to attach to. cmd = 'telnet'arguments = ['localhost', '3001']process = ChildProcess.spawn # 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 ingressProcessStream = PipeegressProcessStream = Pipe
Dependencies
- multipipe: pipe streams with centralized error handling
- watson-developer-cloud: Client library to use the IBM Watson Services and AlchemyAPI
Dev Dependencies
- coffee-script: Unfancy JavaScript
License
MIT
Generated by package-json-to-readme