https://github.com/willbasky/sentencer
Utility to translate text to source/target format for eace sentence. In several languages just for educational purposes.
https://github.com/willbasky/sentencer
Last synced: 11 months ago
JSON representation
Utility to translate text to source/target format for eace sentence. In several languages just for educational purposes.
- Host: GitHub
- URL: https://github.com/willbasky/sentencer
- Owner: willbasky
- License: bsd-3-clause
- Created: 2023-06-17T17:37:27.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-08-04T01:18:53.000Z (almost 3 years ago)
- Last Synced: 2025-03-12T21:17:26.489Z (over 1 year ago)
- Language: Go
- Size: 89.8 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# sentencer
Utility to translate each sentence of a text to source/target
It use [translate-shell](https://github.com/soimort/translate-shell) under hood to communicate with Google Translate Api.
## Example
[Input](./content/sample_tren.txt):
```text
TREN De Alejandro Dolina
(del libro Bar del Infierno)
”El tren pasa solo dos veces por año. Llega a la madrugada y se detiene apeas unos segundos. Es un tren enorme, más largo que la distancia entre las estaciones: cuando los primeros vagones llegan a un pueblo, los últimos aún están en el anterior.
```
[Output](./content/hs_result_tren.txt):
```text
TREN De Alejandro Dolina
ПОЕЗД Алехандро Долина
(del libro Bar del Infierno)
(из книги Адский бар)
”El tren pasa solo dos veces por año.
«Поезд ходит только два раза в год.
Llega a la madrugada y se detiene apeas unos segundos.
Он прибывает на рассвете и останавливается всего на несколько секунд.
Es un tren enorme, más largo que la distancia entre las estaciones: cuando los primeros vagones llegan a un pueblo, los últimos aún están en el anterior.
Это огромный поезд, длиннее, чем расстояние между станциями: когда первые вагоны прибывают в город, последние еще остаются в предыдущем.
```
## How to use
1. Modify [config file](content.toml) directory of input file and name of file.
The configuration via Toml implemented for Haskell, Go and Rust versions.
The paths in other languages hardcoded in sources.
2. Run language-specific command:
- Haskell
```shell
stuck run
```
- PureScript
```shell
spago run
```
- Ocaml
```shell
dune exec osentencer
```
- Go
```shell
go run sentencer/gsentencer
```
- Rust
```shell
cargo run
```
## Roadmap
- [x] Haskell
- [x] PureScript
- [x] Ocaml
- [x] Go
- [x] Rust
- [ ] Python
- [ ] TypeScript
- [ ] Kotlin