usage: wordbook_xml_generator.py [-h] -d DIR [-x XML] [-f FILE]
generate xml for youdao dict wordbook.
optional arguments:
-h, --help show this help message and exit
-d DIR, --dir DIR /path/to/wordbook/dir
-x XML, --xml XML /path/to/xml/file
-f FILE, --file FILE wordbook filename, whose path is relatived to <dir>.
If ignored, all wordbook files in wordbook dir will be
used to generate xml.
<word>\t<translation>\t<phonetic>
awk 'NF == 0{printf "%s\n",word;word="";next}{if(length(word)==0){word=$0}else{word=word" "$0}}
<wordbook>
<item>
<word>apple</word>
<trans><![CDATA[n. 苹果,苹果树,苹果似的东西;[美俚]炸弹,手榴弹,(棒球的)球;[美俚]人,家伙。]]></trans>
<phonetic><![CDATA[['æpl]]]></phonetic>
<tags></tags>
<progress>-1</progress>
</item>
<item>
<word>apple</word>
<trans><![CDATA[n. 苹果,苹果树,苹果似的东西;[美俚]炸弹,手榴弹,(棒球的)球;[美俚]人,家伙。]]></trans>
<phonetic><![CDATA[['æpl]]]></phonetic>
<tags></tags>
<progress>-1</progress>
</item>
<wordbook>