TLFi-light

Le Trésor de la Langue Française informatisé dans votre terminal - retour accueil

git clone git://bebou.netlib.re/TLFi-light
Log | Files | Refs |

getwords (525B)


      1 #! /bin/sh
      2 
      3 for letter in A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
      4 do
      5 	echo "Letter $letter"
      6 	for i in $(seq 0 80 100000)
      7 	do
      8 		printf "	number $i"
      9 		[ -s $letter$i ] && { echo " - already exists, skippin"; continue; }
     10 		printf " - download $letter$i"
     11 		curl -Ls "https://www.cnrtl.fr/portailindex/LEXI/TLFI/$letter/$i" |
     12 			sed -n '/Liste des formes/ p' |
     13 			grep -oE '/definition/[^"]*' |
     14 			cut -d '/' -f3 > $letter$i
     15 		[ ! -s $letter$i ] && { echo " - no more words, next letter";break; }
     16 		echo
     17 	done
     18 done
     19 
     20 
     21