trnsl8

command module
v0.0.0-...-4194c92 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 4, 2021 License: Apache-2.0 Imports: 1 Imported by: 0

README

trnsl8

trnsl8 is a CLI written in Go (using Cobra package) that allows users to translate text and detect the language of input through the use of AWS Translate and AWS Comprehend


Installation

go get -u github.com/gussf/trnsl8

Usage

Translation
# Translates text into a target language
# More information on language codes: https://docs.aws.amazon.com/translate/latest/dg/what-is.html
trnsl8 to <language-code> <text-to-translate>  

# You can input a file to be translated
trnsl8 to <language-code> -f <source-text-file>

# You can save the resulting translation to a file
trnsl8 to <language-code> <text-to-translate> -o <output-file>

# And also both read from and write to files
trnsl8 to <language-code> -f <source-text-file> -o <output-file>
Detection
# Detects what language text is in
trnsl8 detect <text-to-detect> 

# You can also input files for detection
trnsl8 detect -f <text-file>

Examples

# Translation
trnsl8 to ja "I want this sentence in japanese" 
trnsl8 to en "Ich möchte diesen Satz auf Englisch" -o result.txt
trnsl8 to ro -f ~/source.txt -o ~/result.txt  

# Detection
trnsl8 detect "ce limbă este aceasta?" # hint: its romanian!
trnsl8 detect -f really_big_text.txt

Next steps

  • Use docker?
  • Unit tests?

Documentation

Overview

Copyright © 2021 GUSSF

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL