2 つの言語、1 つの形

どの言語で何が null になるか、そしてその理由。フィールドが同じなので、クライアントは 1 つのコンポーネントで両方を描けます。

フィールドごとに

フィールド英語のエントリー日本語のエントリー
pronunciations[].ipa"wɔk"null
pronunciations[].readingnull"たべる"、仮名
pronunciations[].accentnull2: 2 拍目の後で下がる。0 は平板で、下がりません。
pronunciations[].dialect"AmE"null
sounds[].alphabet"ipa""phonetic"
inflections[].tonenull"plain" または "polite"、区別のない形では null
inflections[].polarityいくつかの否定形を除いて null"positive" または "negative"
inflections[].pronunciationsほとんどの形で []その形の読みを持つ 1 行
inflections[].form"past tense"、英語"過去形"、日本語、form_translations.eng 付き
senses[].translations"jpn" をキーに、訳語は readings を持つ"eng" をキーに、読みは空
senses[].pos"verb""動詞"、pos_translations.eng 付き
spellingsほとんど []ラベル付きの別表記

欠けるのではなく null である理由

日本語のエントリー向けに書いたクライアントは、英語のエントリーもそのままパースできます。逆も同じです。言語に依存するのは何を表示するかだけで、どのフィールドが埋まっているかでエントリー自身がそれを示します。追加のみという約束を安く保てるのもこのためです。形が言語で分岐することはありません。

2 つのサンプル

eng · walk · 抜粋
{
  "id": "99680fd6-177c-4eda-bedc-5680c8412d2c",
  "headword": "walk",
  "lang": "eng",
  "frequency_rank": 1866,
  "pronunciations": [
    {
      "ipa": "wɔk",
      "dialect": "AmE",
      "reading": null,
      "accent": null,
      "sounds": [
        {
          "mp3_url": "https://storage.immit.co/sounds/01JW8HJT7W37QETQKNHBDJ36NJ.mp3",
          "voice": "Emma",
          "gender": "female",
          "alphabet": "ipa"
        },
        // … 1 more voice
      ]
    }
  ],
  "senses": [
    {
      "pos": "verb",
      "pos_translations": {
        "jpn": "動詞"
      },
      "definition": "to move along on foot by putting one foot in front of the other, not running",
      "translations": {
        "jpn": {
          "qualifier": null,
          "glosses": [
            {
              "text": "歩く",
              "readings": [
                "あるく"
              ]
            },
            {
              "text": "歩いて行く",
              "readings": []
            }
          ]
        }
      },
      // … examples, ids
    },
    // … 6 more senses
  ],
  "inflections": [
    {
      "text": "walked",
      "form": "past tense",
      "form_translations": {
        "jpn": "過去形"
      },
      "tone": null,
      "polarity": null,
      "pronunciations": []
    },
    // … 4 more rows
  ],
  "spellings": [],
  // … relations, updated_at
}
jpn · 食べる · 抜粋
{
  "id": "9bebf0ab-36ee-4511-a271-f8d0a21efe31",
  "headword": "食べる",
  "lang": "jpn",
  "frequency_rank": 293,
  "pronunciations": [
    {
      "ipa": null,
      "dialect": null,
      "reading": "たべる",
      "accent": 2,
      "sounds": [
        {
          "mp3_url": "https://storage.immit.co/sounds/01M45PR236JEQ21RS26407FZ32.mp3",
          "voice": "Himari",
          "gender": "female",
          "alphabet": "phonetic"
        }
      ]
    }
  ],
  "senses": [
    {
      "pos": "動詞",
      "pos_translations": {
        "eng": "verb"
      },
      "definition": "食物を口に入れ、かんで飲み込む。",
      "translations": {
        "eng": {
          "qualifier": null,
          "glosses": [
            {
              "text": "to eat",
              "readings": []
            },
            {
              "text": "to have (a meal)",
              "readings": []
            }
          ]
        }
      },
      // … examples, ids
    },
    // … 1 more sense
  ],
  "inflections": [
    {
      "text": "食べる",
      "form": "現在形",
      "form_translations": {
        "eng": "present"
      },
      "tone": "plain",
      "polarity": "positive",
      "pronunciations": [
        {
          "reading": "たべる",
          // …
        }
      ]
    },
    // … 42 more rows
  ],
  "spellings": [
    {
      "text": "喰べる",
      "label": "まれな漢字",
      // …
    }
  ],
  // … relations, updated_at
}