Skip to content

Commit

Permalink
bin/translate-readme (#2), bin/save-files (#3), EticaAI-linguistic-da…
Browse files Browse the repository at this point in the history
…tasets-pt-data (#5):

bin/translate-readme: [PT] v2.0 v2.0; abre navegador em vez de usar translate-shell
bin/save-files: [PT] Arquivos de data/ agora são salvos em EticaAI-linguistic-datasets-pt-data
  • Loading branch information
fititnt committed Dec 3, 2020
1 parent 54d393a commit 31ccb1a
Show file tree
Hide file tree
Showing 7 changed files with 85 additions and 54 deletions.
10 changes: 9 additions & 1 deletion README.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,12 @@ not to assume authorship of your contributions for fear of retaliation.

## Working files
- HXL-CPLP-Publico
- <https://drive.google.com/drive/u/1/folders/1VLm29IBV6iOnfagRKKD8cLntDAjIjL0z>
- <https://drive.google.com/drive/u/1/folders/1VLm29IBV6iOnfagRKKD8cLntDAjIjL0z>

# Licença

[![Public Domain](img/dominio-publico.png)](UNLICENSE)

As far as possible under the law, [Etica.AI](https://etica.ai)
waived all copyrights and neighboring or neighboring rights to this
work for the [Public Domain] (UNLICENSE).
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ não assumir autoria de suas contribuições por medo de retaliações.

# Licença

[![Domínio Público](imagens/dominio-publico.png)](UNLICENSE)
[![Domínio Público](img/dominio-publico.png)](UNLICENSE)

Na medida do possível segundo a lei, [Etica.AI](https://etica.ai)
renunciou a todos os direitos autorais e direitos conexos ou vizinhos a este
Expand Down
12 changes: 6 additions & 6 deletions bin/save-files
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
#
# DESCRIPTION: ---
#
# OPTIONS: ---
# OPTIONS: DATA_DIR: enviroment variable to define where to save the
# output
#
# REQUIREMENTS: ---
# BUGS: ---
Expand All @@ -21,9 +22,8 @@
# REVISION: ---
#===============================================================================

# @see https://proxy.hxlstandard.org/data/a16d45

DATA_DIR="$(dirname $(readlink -f $0))/../data"
_DATA_DIR=${DATA_DIR:-/workspace/git/EticaAI/EticaAI-linguistic-datasets-pt-data}

curl https://proxy.hxlstandard.org/data/a16d45/download/Etica_AI_Hate-speech-portuguese_.csv -o "$DATA_DIR/Hate-speech-portuguese.csv"
curl https://proxy.hxlstandard.org/data/a16d45/download/Etica_AI_Hate-speech-portuguese_.csv -o "$DATA_DIR/Hate-speech-portuguese.hxl"
# @see https://proxy.hxlstandard.org/data/a16d45
curl https://proxy.hxlstandard.org/data/a16d45/download/Etica_AI_Hate-speech-portuguese_.csv -o "$_DATA_DIR/Hate-speech-portuguese.csv"
curl https://proxy.hxlstandard.org/data/a16d45/download/Etica_AI_Hate-speech-portuguese_.csv -o "$_DATA_DIR/Hate-speech-portuguese.hxl"
87 changes: 69 additions & 18 deletions bin/translate-readme
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,16 @@
#
# USAGE: translate-readme
#
# DESCRIPTION:
# DESCRIPTION: [PT] Como o projeto EticaAI-linguistic-datasets-pt está focado
# em contribuições em português e para tornar o mais
# acessível possível para novos voluntários, optamos por
# escrever em português e fazer tradução automática sem
# revisão humana. Isso é intencional.
# [EN] Since the EticaAI-linguistic-datasets-pt project is
# focused on Portuguese contributions and to make as
# as acessible as possible for new volunteers, we choosen
# to write in Portuguese and do machine translation with no
# human review at all. This is intentional.
#
# OPTIONS: ---
#
Expand All @@ -16,30 +25,72 @@
# COMPANY: Etica.AI
# LICENSE: Public Domain / BSD Zero Clause License
# SPDX-License-Identifier: Unlicense OR 0BSD
# VERSION: v1.0
# VERSION: v2.0
# CREATED: 2020-12-01 19:32 UTC
# REVISION: ---
# REVISION: 2020-12-03 16:31 UTC [PT] v2.0; abre navegador em vez de usar
# translate-shell
#===============================================================================

# Executando da pasta raiz:
# trans pt:en -brief file://README.md -o README.en.md
# trans pt:en -browser firefox -brief file://README.md
# trans pt:en -browser firefox -brief https://github.com/EticaAI/EticaAI-linguistic-datasets-pt/blob/main/README.md
# trans pt:en -browser firefox -brief https://raw.githubusercontent.com/EticaAI/EticaAI-linguistic-datasets-pt/main/README.md
#### lang ______________________________________________________________________
# TODO: [PT] Tecnicamente é possivel exibir apenas mensagens de ajuda no idioma
# em que o terminal esta rodando. Este bloco é um rascunho disto.
# TODO: [EN] It is technically possible to display only help messages in the
# language in which the terminal is running. This block is a draft
# of this.

# @see https://stackoverflow.com/questions/762631/find-out-if-a-command-exists-on-posix-system
# @see https://stackoverflow.com/questions/592620/how-can-i-check-if-a-program-exists-from-a-bash-script
# @see https://askubuntu.com/questions/350679/get-system-locale-language-code-in-bash-for-a-dynamic-path
# lang=$(locale | grep LANGUAGE | cut -d= -f2 | cut -d_ -f1)

# if ! command -v trans &> /dev/null
if ! command -v trans --version
#### trans/xdg-open open _______________________________________________________
if command -v trans --version
then
echo "trans not found"
echo "https://www.soimort.org/translate-shell/#installation"
echo "[PT] abrindo arquivo no seu navegador agora..."
echo "[EN] opening file in your browser now..."
trans pt:en -browser firefox -brief https://raw.githubusercontent.com/EticaAI/EticaAI-linguistic-datasets-pt/main/README.md
exit
fi

# TODO: This still not working from command line. Needs to execute the
# trans -brief file://README.md -o README.en.md
# directly from the command line.
if command -v xdg-open
then
echo "[PT] abrindo arquivo no seu navegador agora..."
echo "[EN] opening file in your browser now..."
xdg-open "https://translate.google.com/translate?hl=pt&sl=pt&tl=en&u=https://raw.githubusercontent.com/EticaAI/EticaAI-linguistic-datasets-pt/main/README.md"
exit
fi

if command -v open
then
echo "[PT] abrindo arquivo no seu navegador agora..."
echo "[EN] opening file in your browser now..."
open "https://translate.google.com/translate?hl=pt&sl=pt&tl=en&u=https://raw.githubusercontent.com/EticaAI/EticaAI-linguistic-datasets-pt/main/README.md"
exit
fi

echo "[PT] Não foi possivel detectar como abrir interface para ajudar sua tradução de máquina do arquivo README.md"
echo "[EN] It was not possible to detect how to open the interface to help your machine translation of the README.md file"
exit 1


### Não finalizado _____________________________________________________________
# [PT] Em teoria é possível usar o translate-shell para fazer tradução usando
# apenas linha de comando, porém formatação markdown é perdida. Esta parte
# do código está comentada, mas pode servir como base para futuras
# automações
# [EN] In theory it is possible to use translate-shell to do translation using
# only the command line, however markdown formatting is lost. This part of
# the code is commented out, but it can serve as a basis for future
# automations

# if ! command -v trans --version
# then
# echo "[PT] trans não encontrado"
# echo "[EN] trans not found"
# echo "https://www.soimort.org/translate-shell/#installation"
# exit
# fi

# # TODO: This still not working from command line. Needs to execute the
# # trans -brief file://README.md -o README.en.md
# # directly from the command line.

trans pt:en -brief file://README.md -o README.en.md
# trans pt:en -brief file://README.md -o README.en.md
14 changes: 0 additions & 14 deletions data/Hate-speech-portuguese.csv

This file was deleted.

14 changes: 0 additions & 14 deletions data/Hate-speech-portuguese.hxl

This file was deleted.

Binary file added img/dominio-publico.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 31ccb1a

Please sign in to comment.