Special:RandomInCategory/egyszerűsített kínai

#!/bin/bash
unset num
unset hanzi
unset HANZI
unset pinyin
unset xiong
unset tra
unset sim
unset pint
unset grepno
unset POS
num="$1"
echo "$num" > num
echo "$num"
awk "NR==$num"  kína > line
cat line
hanzi=$(cut -f1 line)
echo "$hanzi"
pinyin=$(cut -f2 line)
echo "$pinyin"
xiong=$(cut -f3 line)
echo "$xiong" > xiong
echo "$xiong" 


grepno=$(cut -d' ' -f2 cedict_ts.u8 | grep -P -n "^$hanzi$" | head -1 | cut -d: -f1)
echo ==CC-CEDICT== > cedline
awk "NR==$grepno" cedict_ts.u8  
awk "NR==$grepno" cedict_ts.u8  >> cedline
sim=$(awk "NR==$grepno" cedict_ts.u8  | cut -d' ' -f2)
tra=$(awk "NR==$grepno" cedict_ts.u8  | cut -d' ' -f1)
grep -P "$tra $sim " handedict.u8 | head -1
zero=0

pint=$(awk "NR==$grepno" cedict_ts.u8  | cut -d'[' -f2 | cut -d']' -f1 | sed "s/ //g" )
if [ "$pint" ]
then
echo ==Handedict== >> cedline
grep -P "$tra $sim " handedict.u8 | head -1 >> cedline
fi
#cat P

if [ -n "$(cat cedline | grep /to )"  ]
then
echo ige > POS
POS=$(cat POS)
elif [ -n "$(cat cedline | grep  CL )" ]
then
echo fn > POS
POS=$(cat POS)
elif [ -n "$(cat cedline | grep ly/ )"  ]
then
echo hat > POS
POS=$(cat POS)
elif [ -n "$(cat cedline | grep \(S )"  ]
then
echo fn > POS
POS=$(cat POS)
elif [ -n "$(cat cedline | grep Adj )"  ]
then
echo mell > POS
POS=$(cat POS)
elif [ -n "$(cat cedline | grep Adv )"  ]
then
echo hat > POS
POS=$(cat POS)
else
echo kif > POS
POS=$(cat POS)
fi
rm POS

echo ==CFDICT== >> cedline
grep -P "$tra $sim " cfdict.u8 | head -1 >> cedline

echo ==EDICT== >> cedline
grep -P  "^$tra " edict2u | head -1 >> cedline 

sed -i "s/.*/ &/g" cedline
sed -i "s/^ ==/==/g" cedline
perl -pe 's/([\xe4-\xe9][\x80-\xbf][\x80-\xbf])/[[\1]]/g' cedline > cedd
cp cedd cedline

sed -i "s/\(.*\)/ \1/g" xiong
sed -i "s/ [^ ]\{1,3\}\. /\n/g" xiong
sed -i "s/;//g" xiong
sed -i "s/^$//g" xiong
sed -i "s/^ $//g" xiong
sed -i "s/^  $//g" xiong
sed -i "s/.*/# &/g" xiong
sed -i "s/\[/(/g" xiong
sed -i "s/\]/)/g" xiong
sed -i "s/(\([a-zA-ZöüóőúáűíÖÜÓŐÚÁŰÉÍ]\+\))\([a-zA-ZöüóőúáűíÖÜÓŐÚÁŰÉÍ]\+\)/\1\2/g" xiong
sed -i "s/\([a-zA-ZöüóőúáűíÖÜÓŐÚÁŰÉÍ]\+\)(\([a-zA-ZöüóőúáűíÖÜÓŐÚÁŰÉÍ]\+\))/\1\2/g" xiong
sed -i "s/[A-Za-zöüóőúéáűí]\+/[[&]]/g" xiong


if [ -z $"$(lynx -dump http://hu.wiktionary.org/wiki/Speci%C3%A1lis:Lapok_export%C3%A1l%C3%A1sa/$tra | grep page)" ]
then
TRAD=$(echo "$tra" | sed "s/./\[\[&\]\]/g")
rm entry
echo "{{zh-forms|[[$sim]]|$TRAD}}" > entry
echo "{{zho$POS}}" >> entry
echo "{{cmn-all|t|pin=$pinyin|pint=$pint|sim=$sim|tra=$tra}}" >> entry
cat xiong >> entry
sum=$(cat entry | sed ':a;N;$!ba;s/\n/ /g')
sudo python ../core/add.py -page:$tra -textfile:entry -summary:kínai  -user:中文 -always #-pt:0
fi
if [ -z $"$(lynx -dump http://hu.wiktionary.org/wiki/Speci%C3%A1lis:Lapok_export%C3%A1l%C3%A1sa/Vita:$tra | grep page)" ]
then
sudo python ../core/add.py "-page:Vita:$tra" -textfile:cedline -summary:kínai  -user:中文 -always 
fi

Global accountSzerkesztés

Hi 中文! As a Steward I'm involved in the upcoming unification of all accounts organized by the Wikimedia Foundation (see m:Single User Login finalisation announcement). By looking at your account, I realized that you don't have a global account yet. In order to secure your name, I recommend you to create such account on your own by submitting your password on Special:MergeAccount and unifying your local accounts. If you have any problems with doing that or further questions, please don't hesitate to contact me on my talk page. Cheers, DerHexer (vita) 2015. január 11., 16:30 (CET)