No description
  • JavaScript 100%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2019-05-21 09:54:13 +02:00
Liste-mots-formatés écriture des programmes, génération des fichiers et readme 2019-03-24 15:39:44 +01:00
Programmes petite modification 2019-05-21 09:54:13 +02:00
.gitignore premier commit 2019-02-10 20:36:54 +01:00
A-FAIRE.md premier commit 2019-02-10 20:36:54 +01:00
README.md écriture des programmes, génération des fichiers et readme 2019-03-24 15:39:44 +01:00

CFDICT

This is the French counterpart of the Cedcit Chinese-English dictionary.

The dictionary is delivered in an xml format.

I tranformed the original file in a new xml, csv and json formated files, with my own and similar format across my projects.

I first tranform the original into a json format with the same structure as the original with a command line utility. I then applied my programs to get the formats I wanted.

Original XML format:

<word>
	<id>30702</id>
	<upd>0</upd>
	<trad>〇</trad>
	<simp>〇</simp>
	<py>ling2</py>
	<trans>
		<fr><![CDATA[0]]></fr>
		<fr><![CDATA[zéro]]></fr>
	</trans>
</word>

Corresponding json:

{
        "id": [
          "30702"
        ],
        "upd": [
          "0"
        ],
        "trad": [
          "〇"
        ],
        "simp": [
          "〇"
        ],
        "py": [
          "ling2"
        ],
        "trans": [
          {
            "fr": [
              "0",
              "zéro"
            ]
          }
        ]
  }

After passing threw my programs:

  • CSV: one line

    㱩	殰	dú	avortement / mort-né	CFdict
    
  • xml: one record

    <ligne>
        <hanzi>〇</hanzi>
        <traditional>〇</traditional>
        <pinyin>líng</pinyin>
        <translations>0</translations>
        <translations>zéro</translations>
        <origin>CFdict</origin>
      </ligne>
    
  • json: the beginning and the first record

    "CFdict": [
        {
          "hanzi": "〇",
          "traditional": "〇",
          "pinyin": "líng",
          "translations": [
            "0",
            "zéro"
          ],
          "origin": "CFdict"
        }, etc ....