#!/bin/bash
LANG="en de nl fr it ru es sv pl ja ar he hi ko zh"
# link prefix languages
LANG="ar ckb cu cv hy is kaa ka lbe ln mzn pnb uk uz"
HOWMANY=10000

for l in $LANG ; do
    echo $l
    zcat ${l}wiki-latest-all-titles-in-ns0.gz | sort -R > ${l}wiki-shuffled-titles
    head -${HOWMANY} ${l}wiki-shuffled-titles > ${l}wiki-${HOWMANY}
    head -2 ${l}wiki-${HOWMANY}
    bzip2 ${l}wiki-shuffled-titles &
    $(dirname $0)/jsonify.js ${l}wiki-${HOWMANY} > ${l}wiki-${HOWMANY}.json
done
