Aprenda inglês em casa
Baixe gratuitamente as duas primeiras aulas
English for Reading and Listening
Receba por email, diariamente, mensagens contendo materiais para leitura e audição, incluindo arquivos no formato MP3 gravados por falantes nativos.
|
Busca |
Aprenda inglês em casa
Baixe gratuitamente as duas primeiras aulas
English for Reading and Listening
Receba por email, diariamente, mensagens contendo materiais para leitura e audição, incluindo arquivos no formato MP3 gravados por falantes nativos.
Assine a Lista Dicas-L
Receba diariamente por email as dicas
de informática publicadas neste site
Para se descadastrar, clique aqui.
Colaboração: Juan Carlos Castro y Castro
Data de Publicação: 02 de Outubro de 2005
dica: Com este script, você pode gerar uma sequência de parágrafos de tamanho arbitrário usando o pacote "words", wue vem instalado em (pelo que sei) todas as distribuições Linux e que originalmente serve para evitar que usuários criem senhas para sí próprios que sejam palavras conhecidas. O arquivo fica em /usr/share/dict/words (No Fedora Core 3, pode ser que em outra distro o caminho seja diferente).
Se alguém souber de um pacote correspondente só com palavras da língua portuguesa, ficará facílimo gerar uma versão que gera palavreado na língua pátria. O pessoal que trabalha com tipografia pode achar isto útil para gerar texto "filler".
Abaixo o script, e um resultado de rodá-lo com os parâmetros "3 3 10 30":
<i>Exhortatively adventual fogon all-bitter ruths. Groundliness Forsythe Rieka but coinitial Mantuan but megalomaniacally Urey semiresoluteness but toatoa tibiae thought-laden Hibernical quasi-victorious immaculate syncretical the unofficiously multimetalic house totes cassena strickled sewages vapidity.
Wavy-edged gadrooned enalid discants astronomics preffroze. Arion unheritable Filicites concoagulate loathness cantillated superintenseness recooper nonsusceptive the Timotheus of giblet-checked Trinl deflexed qualmy histodiagnosis befrocked handbreed cookery cicrumspections IAS.
Buzzword. Prefabrications neat-dressed yellow-hilted monoketone genecology and atua. Hendaye of Corinna and Cervulus blepharoplast.</i>
#!/bin/sh
#
# gibberish.sh - Generate Burroughsesque text
# This script is in the PUBLIC DOMAIN
#
# Use: gibberish.sh [pmin] [pmax] [wordsmin] [wordsmax]
# pmin, pmax - Minumum and maximum # of paragraphs
# wordsmin, wordsmax - Minimum and maximum words per paragraph
# (not counting "of", "the", "and", "or", "but")
#
# Defaults: 3 8 30 130
#
export NPARMIN=3
export NPARMAX=8
export NWORDSPARMIN=30
export NWORDSPARMAX=130
if [ "$4" != "" ]; then
export NWORDSPARMAX=$4
fi
if [ "$3" != "" ]; then
export NWORDSPARMIN=$3
fi
if [ "$2" != "" ]; then
export NPARMAX=$2
fi
if [ "$1" != "" ]; then
export NPARMIN=$1
fi
if [ 0$NWORDSPARMAX -lt 0$NWORDSPARMIN ]; then
export NWORDSPARMAX=$NWORDSPARMIN
fi
if [ 0$NPARMAX -lt 0$NPARMIN ]; then
export NPARMAX=$NPARMIN
fi
export NWORDSPARRNG=$(($NWORDSPARMAX-$NWORDSPARMIN))
export NPARRNG=$(($NPARMAX-$NPARMIN))
awk '
BEGIN {
nwords = 0;
}
{
wlist[nwords++] = $0;
}
END {
srand();
npars = 3 + int(5 * rand());
npars = ENVIRON["NPARMIN"] + int(ENVIRON["NPARRNG"] * rand());
for (par = 0; par < npars; par++)
{
nwordspar = ENVIRON["NWORDSPARMIN"] + int(ENVIRON["NWORDSPARRNG"] * rand());
for (i = 0; i < nwordspar; i++)
{
thisword = wlist[int(nwords * rand())];
if (i > 0)
{
if (int(15 * rand()) == 8)
printf ". %s%s", toupper(substr(thisword,1,1)), substr(thisword,2);
else if (int(20 * rand()) == 19)
printf " of %s", thisword;
else if (int(20 * rand()) == 18)
printf " the %s", thisword;
else if (int(20 * rand()) == 17)
printf " and %s", thisword;
else if (int(20 * rand()) == 16)
printf " or %s", thisword;
else if (int(20 * rand()) == 15)
printf " but %s", thisword;
else
printf " %s", thisword;
}
else
printf "%s%s", toupper(substr(thisword,1,1)), substr(thisword,2);
}
printf ".\n\n";
}
}' </usr/share/dict/words
Veja a relação completa dos artigos de Juan Carlos Castro y Castro
Referências adicionais sobre os assuntos abordados neste site podem ser encontradas em nossa Bibliografia.
![]() Recomendar este artigo |
|
Seminário Investindo em Ações
Conceitos Fundamentais para Iniciantes
Dias 13 de Setembro - São Paulo
Saiba mais
Redes - Guia Prático
Por Carlos. E. Morimoto
Hardware - o Guia Definitivo
Por Carlos. E. Morimoto
Kurumin 7 - Guia Prático
Por Carlos. E. Morimoto
Linux: Ferramentas Técnicas, 2ed
Por Carlos. E. Morimoto
Use a Cabeça!: JSP & Servlets
Por Brian Bashan, Kathy Sierra, Bert Bates
Google Hacking
Por JOHNNY LONG
1808
Por Laurentino Gomes
Sistemas de Banco de Dados
Por Ramez E. Elmasri e Shamkant Navathe
Linux: Guia do Administrador do Sistema
Por Rubem E. Ferreira
A Menina que Roubava Livros
Por Markus Zusak
Sistemas Operacionais Modernos
Por Andrew S. Tanembaum
Hardware: Curso Completo
Por Gabriel Torres
PHP para Quem Conhece PHP
Por Juliano Niederauer
Redes de Computadores: Curso Completo
Por Gabriel Torres
Java: Como Programar
Por Harvey M. Deitel e Paul J. Deitel
O Caçador de Pipas
Por Khaled Hosseini
O Médico Doente
Por Dráuzio Varella
Enterprise Javabeans 3.0
Por Bill Burke, Richard Monson
MySQL - Guia do Programador
Por André Milani
Certificação Linux
Por Uira Ribeiro
Manual Completo do Linux: Guia do Administrador
Por Evi Nemeth, Trent R. Hein, Garth Snyder
OpenGL: uma Abordagem Prática e Objetiva
Por Marcelo Cohen, Isabel Harb Manssour
Expressões Regulares: Uma Abordagem Divertida
Por Aurélio Marinho Jargas
Extreme Programming
Por Vinicius Manhaes Teles