Giter Club home page Giter Club logo

fast-translation's Introduction

描述

基于命令行的快速翻译,可直接翻译单词句子

使用的百度翻译API

说明

  • trs.py: 翻译,可翻译单词或句子,支持文件翻译;
  • dc.py: 主要是词典解析,指定单词翻译;

使用:

翻译句子或单词

  • 直接输入文本

      > ./trs.py "Hello World"
      > 你好世界
    
      > ./trs.py "你好世界"
      > Hello world
    
  • 翻译文件

      > echo "Hello World" > test.txt
      > ./trs.py test.txt
      > 你好世界
    
  • 推荐使用方法

      > sudo cp ./trs.py /usr/bin/trs
      > sudo chmod +x /usr/bin/trs
    
      > trs "Hello World"
      > 你好世界
    
      > trs test.txt
      > 你好世界
    

词典:

  • 直接待翻译的单词

      > ./dc.py "Hello"
      >   ##################################################
          hello [英]:[hə'ləʊ] [美]:[hɛˈlo, hə-]
          int. 哈喽,喂; 你好,您好; 表示问候; 打招呼
          n. “喂”的招呼声或问候声
          vi. 喊“喂”
          ##################################################
    
      > ./dc.py "你好"
      >   ##################################################
          你好 [nǐ hǎo]
          hello; hi; How do you do!
          ##################################################
    
  • 推荐使用方法

      > sudo cp ./dc.py /usr/bin/dc
      > sudo chmod +x /usr/bin/dc
    
      > dc "Hello"
      >   ##################################################
          hello [英]:[hə'ləʊ] [美]:[hɛˈlo, hə-]
          int. 哈喽,喂; 你好,您好; 表示问候; 打招呼
          n. “喂”的招呼声或问候声
          vi. 喊“喂”
          ##################################################
    
      > dc "你好"
      >   ##################################################
          你好 [nǐ hǎo]
          hello; hi; How do you do!
          ##################################################
    

fast-translation's People

Contributors

kaito-kidd avatar

Watchers

 avatar  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.