From: <mga...@us...> - 2003-10-24 01:34:48
|
Update of /cvsroot/openoffice-es/dic-es In directory sc8-pr-cvs1:/tmp/cvs-serv26806 Added Files: wordlist.sh Log Message: Scripts para extraer una lista de palabras a partir de un texto (se necesita linux) --- NEW FILE: wordlist.sh --- #!/bin/sh # wordlist.sh # Extractor de palabras #------------------------------------------------------------------------------ # Uso: # Se necesita un archivo en formato texto, talvez en UTF8, # que contiene el texto por la cual este scripts extraerá las # palabras (wordlist). El nombre que tendrá será TEXTO.txt # y estará en la misma carpeta donde se ejecute el scripts. # Luego ejecutar './wordlist.sh. # Al final del proceso se optendrá el archivo con el # nombre: LISTA_FINAL.txt #------------------------------------------------------------------------------ # Marcelo Garrone <mga...@mo...> 2003 #------------------------------------------------------------------------------ # Extrae palabras para colocarlas en cada linea para después ordenarlas alfabeticamente (for i in `cat TEXTO.txt`; do echo $i; done) | sort -u > lista.txt # Elimina los carácteres de las palabras: puntuaciones y los signos ?!#&$¿¡|»« tr -d '[:punct:]\?\!\#\&\$\¿\¡\|\»\«' <lista.txt > lista2.txt # Elimina las lineas que contienen los carácteres: =@-+0123456789/()<>$_. y las que contienen mayúscula A-ZÁÉÍÓÚ sed -e '/=/d' -e '/@/d' -e '/\-/d' -e '/+/d' -e '/[0-9]/d' -e '/\//d' -e '/(/d' -e '/)/d' -e '/</d' -e '/>/d' -e '/^$/d' -e '/_/d' -e '/^.$/d' -e '/^[A-ZÁÉÍÓÚ][A-ZÁÉÍÓÚ]*$/d' <lista2.txt > lista3.txt # Coloca nuevamente las palabras en cada linea para después ordenarlas alfabeticamente (for i in `cat lista3.txt`; do echo $i; done) | sort -u -b > lista4.txt # Borra lineas duplicadas uniq lista4.txt LISTA_FINAL.txt # Borra los archivos temporales creados en el proceso de extracción. rm -f lista* |