bs-tureng-cli


Namebs-tureng-cli JSON
Version 1.0.0 PyPI version JSON
download
home_page
SummaryBaysanSoft Tureng CLI for EN-TR translation
upload_time2023-10-31 13:19:30
maintainer
docs_urlNone
author@mebaysan
requires_python>=3.8
licenseMIT
keywords mebaysan translation turkish english tureng cli
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            - [Introduction](#introduction)
- [Installation](#installation)
  - [Install As a Bash Script](#install-as-a-bash-script)
    - [Commands as Bash script](#commands-as-bash-script)
- [Usage](#usage)
  - [translate](#translate)
  - [sentence](#sentence)
  - [synonym](#synonym)
  - [Error Handling](#error-handling)
  - [Help about parameters](#help-about-parameters)

# Introduction

I created this repo to easily translate English and Turkish words by using very good project, [Tureng](https://tureng.com/en/turkish-english).

This CLI basically scrapes [https://tureng.com/en/turkish-english](https://tureng.com/en/turkish-english) link to parse translation results. You can just pass the word as a parameter to translate.

# Installation

You can easily start using the CLI by installing it as a package on your Python environment.

```bash
pip install .
```

Or you can install it by using the command below

```bash
pip install git+https://github.com/BaysanSoft/Tureng-Translation-CLI.git
```

Or you can just use `sudo make install`.

## Install As a Bash Script

If you want to use it from bash, you can just move [tureng-cli.sh](tureng-cli.sh) to `/usr/sbin/`.

**!With this kind of installation, you can use `translate` command for default.**

```bash
>>> sudo mv tureng-cli.sh /usr/sbin/
>>> turenh-cli.sh "hurricane"

Meanings of "hurricane" in Turkish English Dictionary : 15 result(s)
#       Category        English         Turkish
1       + Common Usage  + hurricane     + kasırga
2       + General       + hurricane     + fırtına
3       + General       + hurricane     + urağan
4       + General       + hurricane     + kasırga
5       + General       + hurricane     + (güç veya hız bakımından) kasırgaya benzeyen şey
6       + Technical     + hurricane     + bora
7       + Technical     + hurricane     + kasırga
8       + Environment   + hurricane     + tropik siklon
9       + Geography     + hurricane     + kasırga
10      + Geography     + hurricane     + batı virginia eyaletinde şehir
11      + Geography     + hurricane     + utah eyaletinde şehir
12      + Meteorology   + hurricane     + bora
13      + Meteorology   + hurricane     + hortum
14      + Meteorology   + hurricane     + kasırga
15      + Military      + hurricane     + ikinci dünya savaşı'nda ingilizler tarafından kullanılan bir savaş uçağı
```

### Commands as Bash script

[tureng.sh](tureng.sh) file helps us to execute commands from Bash.

Syntax:

`tureng.sh {command} "{word}" {n_result: default 15}`

Example of usage:

`tureng.sh synonym "hurricane" 15`

```bash
>>> sudo mv tureng.sh /usr/sbin/
>>> tureng.sh synonym "hurricane" 2

Hurricane synonyms
#       Synonym         Defination
1       + cyclone       +  (Meteorol.) A system of rotating winds over a vast area, spinning inward to a low pressure center (counterclockwise in the N Hemisphere) and generally causing stormy weather: commonly called a low, since it coexists with low barometric pressure
2       + typhoon       +  A violent cyclonic storm occurring in the western Pacific Ocean.

```

# Usage

## translate

This command is using for translating words.

There are basically 2 parameters by using the CLI:

- `-w` or `--word` for words to translate in both language Turkish or English
- `-n` or `--n-results` to limit the result of the translation rows

The example below is for Turkish -> English.

```bash
>>> tureng-cli translate -w Kasırga -n 10

Meanings of "kasırga" in English Turkish Dictionary : 33 result(s)
#       Category        Turkish         English
1       + Common Usage  + kasırga       + hurricane
2       + Common Usage  + kasırga       + whirlwind
3       + General       + kasırga       + wind
4       + General       + kasırga       + cyclone
5       + General       + kasırga       + twist
6       + General       + kasırga       + squall
7       + General       + kasırga       + windstorm
8       + General       + kasırga       + whirlwind
9       + General       + kasırga       + twister
10      + General       + kasırga       + tourbillion

```

The example below is for English -> Turkish.

```bash
>>> tureng-cli translate -w Hurricane -n 10

Meanings of "hurricane" in Turkish English Dictionary : 15 result(s)
#       Category        English         Turkish
1       + Common Usage  + hurricane     + kasırga
2       + General       + hurricane     + fırtına
3       + General       + hurricane     + urağan
4       + General       + hurricane     + kasırga
5       + General       + hurricane     + (güç veya hız bakımından) kasırgaya benzeyen şey
6       + Technical     + hurricane     + bora
7       + Technical     + hurricane     + kasırga
8       + Environment   + hurricane     + tropik siklon
9       + Geography     + hurricane     + kasırga
10      + Geography     + hurricane     + batı virginia eyaletinde şehir

```

## sentence

This command is using for showing sentence examples.

There are basically 2 parameters by using the CLI:

- `-w` or `--word` for words to get the related sentences with it
- `-n` or `--n-results` to limit the result of the translation rows

```bash
>>> tureng-cli sentence -w "Hurricane" -n 10

Hurricane sentence example
#       Sentence
1       + Oh, and the tropical storm will become a hurricane late Saturday night.
2       + The town was considerably damaged by the great hurricane of the 8th of August 1899.
3       + He'd managed to miss the hurricane, though the waters were still rough and the waves high.
4       + Everything needs to be ready, especially if the hurricane shifts to make landfall.
5       + In 1907 a hurricane destroyed the greater part of the laurels of the Prado and the royal palms of the Parque de Colon.
6       + He felt like he'd been hit by a hurricane.
7       + In 1090 a tremendous hurricane passed over London, and blew down six hundred houses and many churches.
8       + An open space forming the heart of the square in which the church stands separates the solitary western tower (14th century) from the choir and transept, the nave having been blown down by a violent hurricane in 1674 and never rebuilt.
9       + In July, on the approach of the dangerous hurricane season, Rodney sailed for North America, reaching New York on the 14th of September.
10      + The hurricane, too, was followed by repeated droughts, and the inhabitants of the out-islands were reduced to indigence and want, a condition which is still, in some measure, in evidence.

```

## synonym

This command is using for showing synonyms of the word.

There are basically 2 parameters by using the CLI:

- `-w` or `--word` for words to get related synonyms
- `-n` or `--n-results` to limit the result of the translation rows

```bash
>>> tureng-cli synonym -w "Hurricane" -n 3

Hurricane synonyms
#       Synonym         Defination
1       + cyclone       +  (Meteorol.) A system of rotating winds over a vast area, spinning inward to a low pressure center (counterclockwise in the N Hemisphere) and generally causing stormy weather: commonly called a low, since it coexists with low barometric pressure
2       + typhoon       +  A violent cyclonic storm occurring in the western Pacific Ocean.
3       + wind          +  The wind instruments of an orchestra, or the players of these instruments

```

## Error Handling

```bash
>>> tureng-cli translate -w "excissment" -n 10

Maybe the correct one is
excitement
exciseman
excipient
excise
excised
excipients
excising
excimer
excision
excitant
```

## Help about parameters

You can use `--help` flag to get help.

```bash
>>> tureng-cli --help

Usage: cli.py [OPTIONS] COMMAND [ARGS]...

Options:
  --help  Show this message and exit.

Commands:
  translate  Command to translate a Turkish word to English
```

Or you can get help for specific commands.

```bash
>>> tureng-cli translate --help

Usage: cli.py translate [OPTIONS]

  Command to translate a Turkish word to English

  Args:     word (str): Turkish word     n (int): The range of the list of
  translated results

Options:
  -w, --word TEXT         A word to translate from Turkish.
  -n, --n-result INTEGER  N rows to show.
  --help                  Show this message and exit.
```

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "bs-tureng-cli",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "mebaysan translation Turkish English Tureng CLI",
    "author": "@mebaysan",
    "author_email": "mail@mebaysan.com",
    "download_url": "",
    "platform": null,
    "description": "- [Introduction](#introduction)\n- [Installation](#installation)\n  - [Install As a Bash Script](#install-as-a-bash-script)\n    - [Commands as Bash script](#commands-as-bash-script)\n- [Usage](#usage)\n  - [translate](#translate)\n  - [sentence](#sentence)\n  - [synonym](#synonym)\n  - [Error Handling](#error-handling)\n  - [Help about parameters](#help-about-parameters)\n\n# Introduction\n\nI created this repo to easily translate English and Turkish words by using very good project, [Tureng](https://tureng.com/en/turkish-english).\n\nThis CLI basically scrapes [https://tureng.com/en/turkish-english](https://tureng.com/en/turkish-english) link to parse translation results. You can just pass the word as a parameter to translate.\n\n# Installation\n\nYou can easily start using the CLI by installing it as a package on your Python environment.\n\n```bash\npip install .\n```\n\nOr you can install it by using the command below\n\n```bash\npip install git+https://github.com/BaysanSoft/Tureng-Translation-CLI.git\n```\n\nOr you can just use `sudo make install`.\n\n## Install As a Bash Script\n\nIf you want to use it from bash, you can just move [tureng-cli.sh](tureng-cli.sh) to `/usr/sbin/`.\n\n**!With this kind of installation, you can use `translate` command for default.**\n\n```bash\n>>> sudo mv tureng-cli.sh /usr/sbin/\n>>> turenh-cli.sh \"hurricane\"\n\nMeanings of \"hurricane\" in Turkish English Dictionary : 15 result(s)\n#       Category        English         Turkish\n1       + Common Usage  + hurricane     + kas\u0131rga\n2       + General       + hurricane     + f\u0131rt\u0131na\n3       + General       + hurricane     + ura\u011fan\n4       + General       + hurricane     + kas\u0131rga\n5       + General       + hurricane     + (g\u00fc\u00e7 veya h\u0131z bak\u0131m\u0131ndan) kas\u0131rgaya benzeyen \u015fey\n6       + Technical     + hurricane     + bora\n7       + Technical     + hurricane     + kas\u0131rga\n8       + Environment   + hurricane     + tropik siklon\n9       + Geography     + hurricane     + kas\u0131rga\n10      + Geography     + hurricane     + bat\u0131 virginia eyaletinde \u015fehir\n11      + Geography     + hurricane     + utah eyaletinde \u015fehir\n12      + Meteorology   + hurricane     + bora\n13      + Meteorology   + hurricane     + hortum\n14      + Meteorology   + hurricane     + kas\u0131rga\n15      + Military      + hurricane     + ikinci d\u00fcnya sava\u015f\u0131'nda ingilizler taraf\u0131ndan kullan\u0131lan bir sava\u015f u\u00e7a\u011f\u0131\n```\n\n### Commands as Bash script\n\n[tureng.sh](tureng.sh) file helps us to execute commands from Bash.\n\nSyntax:\n\n`tureng.sh {command} \"{word}\" {n_result: default 15}`\n\nExample of usage:\n\n`tureng.sh synonym \"hurricane\" 15`\n\n```bash\n>>> sudo mv tureng.sh /usr/sbin/\n>>> tureng.sh synonym \"hurricane\" 2\n\nHurricane synonyms\n#       Synonym         Defination\n1       + cyclone       +  (Meteorol.) A system of rotating winds over a vast area, spinning inward to a low pressure center (counterclockwise in the N Hemisphere) and generally causing stormy weather: commonly called a low, since it coexists with low barometric pressure\n2       + typhoon       +  A violent cyclonic storm occurring in the western Pacific Ocean.\n\n```\n\n# Usage\n\n## translate\n\nThis command is using for translating words.\n\nThere are basically 2 parameters by using the CLI:\n\n- `-w` or `--word` for words to translate in both language Turkish or English\n- `-n` or `--n-results` to limit the result of the translation rows\n\nThe example below is for Turkish -> English.\n\n```bash\n>>> tureng-cli translate -w Kas\u0131rga -n 10\n\nMeanings of \"kas\u0131rga\" in English Turkish Dictionary : 33 result(s)\n#       Category        Turkish         English\n1       + Common Usage  + kas\u0131rga       + hurricane\n2       + Common Usage  + kas\u0131rga       + whirlwind\n3       + General       + kas\u0131rga       + wind\n4       + General       + kas\u0131rga       + cyclone\n5       + General       + kas\u0131rga       + twist\n6       + General       + kas\u0131rga       + squall\n7       + General       + kas\u0131rga       + windstorm\n8       + General       + kas\u0131rga       + whirlwind\n9       + General       + kas\u0131rga       + twister\n10      + General       + kas\u0131rga       + tourbillion\n\n```\n\nThe example below is for English -> Turkish.\n\n```bash\n>>> tureng-cli translate -w Hurricane -n 10\n\nMeanings of \"hurricane\" in Turkish English Dictionary : 15 result(s)\n#       Category        English         Turkish\n1       + Common Usage  + hurricane     + kas\u0131rga\n2       + General       + hurricane     + f\u0131rt\u0131na\n3       + General       + hurricane     + ura\u011fan\n4       + General       + hurricane     + kas\u0131rga\n5       + General       + hurricane     + (g\u00fc\u00e7 veya h\u0131z bak\u0131m\u0131ndan) kas\u0131rgaya benzeyen \u015fey\n6       + Technical     + hurricane     + bora\n7       + Technical     + hurricane     + kas\u0131rga\n8       + Environment   + hurricane     + tropik siklon\n9       + Geography     + hurricane     + kas\u0131rga\n10      + Geography     + hurricane     + bat\u0131 virginia eyaletinde \u015fehir\n\n```\n\n## sentence\n\nThis command is using for showing sentence examples.\n\nThere are basically 2 parameters by using the CLI:\n\n- `-w` or `--word` for words to get the related sentences with it\n- `-n` or `--n-results` to limit the result of the translation rows\n\n```bash\n>>> tureng-cli sentence -w \"Hurricane\" -n 10\n\nHurricane sentence example\n#       Sentence\n1       + Oh, and the tropical storm will become a hurricane late Saturday night.\n2       + The town was considerably damaged by the great hurricane of the 8th of August 1899.\n3       + He'd managed to miss the hurricane, though the waters were still rough and the waves high.\n4       + Everything needs to be ready, especially if the hurricane shifts to make landfall.\n5       + In 1907 a hurricane destroyed the greater part of the laurels of the Prado and the royal palms of the Parque de Colon.\n6       + He felt like he'd been hit by a hurricane.\n7       + In 1090 a tremendous hurricane passed over London, and blew down six hundred houses and many churches.\n8       + An open space forming the heart of the square in which the church stands separates the solitary western tower (14th century) from the choir and transept, the nave having been blown down by a violent hurricane in 1674 and never rebuilt.\n9       + In July, on the approach of the dangerous hurricane season, Rodney sailed for North America, reaching New York on the 14th of September.\n10      + The hurricane, too, was followed by repeated droughts, and the inhabitants of the out-islands were reduced to indigence and want, a condition which is still, in some measure, in evidence.\n\n```\n\n## synonym\n\nThis command is using for showing synonyms of the word.\n\nThere are basically 2 parameters by using the CLI:\n\n- `-w` or `--word` for words to get related synonyms\n- `-n` or `--n-results` to limit the result of the translation rows\n\n```bash\n>>> tureng-cli synonym -w \"Hurricane\" -n 3\n\nHurricane synonyms\n#       Synonym         Defination\n1       + cyclone       +  (Meteorol.) A system of rotating winds over a vast area, spinning inward to a low pressure center (counterclockwise in the N Hemisphere) and generally causing stormy weather: commonly called a low, since it coexists with low barometric pressure\n2       + typhoon       +  A violent cyclonic storm occurring in the western Pacific Ocean.\n3       + wind          +  The wind instruments of an orchestra, or the players of these instruments\n\n```\n\n## Error Handling\n\n```bash\n>>> tureng-cli translate -w \"excissment\" -n 10\n\nMaybe the correct one is\nexcitement\nexciseman\nexcipient\nexcise\nexcised\nexcipients\nexcising\nexcimer\nexcision\nexcitant\n```\n\n## Help about parameters\n\nYou can use `--help` flag to get help.\n\n```bash\n>>> tureng-cli --help\n\nUsage: cli.py [OPTIONS] COMMAND [ARGS]...\n\nOptions:\n  --help  Show this message and exit.\n\nCommands:\n  translate  Command to translate a Turkish word to English\n```\n\nOr you can get help for specific commands.\n\n```bash\n>>> tureng-cli translate --help\n\nUsage: cli.py translate [OPTIONS]\n\n  Command to translate a Turkish word to English\n\n  Args:     word (str): Turkish word     n (int): The range of the list of\n  translated results\n\nOptions:\n  -w, --word TEXT         A word to translate from Turkish.\n  -n, --n-result INTEGER  N rows to show.\n  --help                  Show this message and exit.\n```\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "BaysanSoft Tureng CLI for EN-TR translation",
    "version": "1.0.0",
    "project_urls": null,
    "split_keywords": [
        "mebaysan",
        "translation",
        "turkish",
        "english",
        "tureng",
        "cli"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6cc3c76f27440fb0f0519836f4d7fb3f16a165527770bbbab54fb522ac6dcb31",
                "md5": "6a38b6242614d050571b942120ab2289",
                "sha256": "116e5e9df9b33e7f7fc6218ba047e4ca735b1c5f25d04f8c6eb3aef5dbd2154a"
            },
            "downloads": -1,
            "filename": "bs_tureng_cli-1.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "6a38b6242614d050571b942120ab2289",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 11675,
            "upload_time": "2023-10-31T13:19:30",
            "upload_time_iso_8601": "2023-10-31T13:19:30.906820Z",
            "url": "https://files.pythonhosted.org/packages/6c/c3/c76f27440fb0f0519836f4d7fb3f16a165527770bbbab54fb522ac6dcb31/bs_tureng_cli-1.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-10-31 13:19:30",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "bs-tureng-cli"
}
        
Elapsed time: 0.13544s