Skip to content

Commit

Permalink
chore(xiaoxiao): convert escape
Browse files Browse the repository at this point in the history
  • Loading branch information
amorphobia committed Sep 7, 2024
1 parent 635bb2f commit 7a94257
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions scripts/make_dicts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -174,12 +174,15 @@ user=mb/jiandao.user.txt
[data]
EOF

awk -v FS='\t' -v OFS=' ' '{print $2,$1}' ${BASEDIR}/../dicts/01.danzi.txt >> ${XIAOXIAO}
awk -v FS='\t' -v OFS=' ' '{print $2,$1}' <(cat ${BASEDIR}/../dicts/01.danzi.txt | tr -d '\r') >> ${XIAOXIAO}
awk -v FS='\t' -v OFS=' ' 'NR==FNR {map[$1] = $2; next} {if (!map[$1]) print $2,$1; else print $2,"$["$1"("map[$1]")]"$1}' ${BASEDIR}/../dicts/06.630.txt ${BASEDIR}/../dicts/02.cizu.txt >> ${XIAOXIAO}
awk -v FS='\t' -v OFS=' ' '{print $2,$1}' ${BASEDIR}/../dicts/03.fuhao.txt >> ${XIAOXIAO}
awk -v FS='\t' -v OFS=' ' '{print $2,$1}' ${BASEDIR}/../dicts/04.buchong.txt >> ${XIAOXIAO}
awk -v FS='\t' -v OFS=' ' '{print $2,$1}' ${BASEDIR}/../dicts/06.630.txt >> ${XIAOXIAO}
cat ${BASEDIR}/../dicts/xiaoxiao.txt >> ${XIAOXIAO}
awk -v FS='\t' -v OFS=' ' '{print $2,$1}' <(cat ${BASEDIR}/../dicts/03.fuhao.txt | tr -d '\r') >> ${XIAOXIAO}
awk -v FS='\t' -v OFS=' ' '{print $2,$1}' <(cat ${BASEDIR}/../dicts/04.buchong.txt | tr -d '\r') >> ${XIAOXIAO}
awk -v FS='\t' -v OFS=' ' '{print $2,$1}' <(cat ${BASEDIR}/../dicts/06.630.txt | tr -d '\r') >> ${XIAOXIAO}
cat ${BASEDIR}/../dicts/xiaoxiao.txt | tr -d '\r' >> ${XIAOXIAO}
sed -i -e 's/\\n/$\//g' ${XIAOXIAO}
sed -i -e 's/\\t/\t/g' ${XIAOXIAO}
sed -i -e 's/\\\\/\\/g' ${XIAOXIAO}

cat << EOF > $(dirname "${XIAOXIAO}")/jiandao.user.txt
# 编码必须为 GB18030
Expand Down

0 comments on commit 7a94257

Please sign in to comment.