|
|
|
@ -22,7 +22,9 @@ pub struct JmdictEntry {
|
|
|
|
|
#[derive(Deserialize)]
|
|
|
|
|
#[serde(rename_all(deserialize = "PascalCase"), deny_unknown_fields)]
|
|
|
|
|
pub struct JmdictExample {
|
|
|
|
|
pub srce: JmdictExampleSource,
|
|
|
|
|
// Always empty with latest version of JMdict
|
|
|
|
|
#[serde(default, skip_serializing, deserialize_with = "err_if_not_blank")]
|
|
|
|
|
srcaswdfa: serde::de::IgnoredAny,
|
|
|
|
|
pub sentences: Vec<JmdictExampleSentence>,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -34,13 +36,6 @@ pub struct JmdictExampleSentence {
|
|
|
|
|
pub text: String,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[derive(Deserialize)]
|
|
|
|
|
#[serde(rename_all(deserialize = "PascalCase"), deny_unknown_fields)]
|
|
|
|
|
pub struct JmdictExampleSource {
|
|
|
|
|
pub id: String,
|
|
|
|
|
pub src_type: JmdictExampleSourceSrcType,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[derive(Deserialize)]
|
|
|
|
|
#[serde(rename_all(deserialize = "PascalCase"), deny_unknown_fields)]
|
|
|
|
|
pub enum JmdictExampleSourceSrcType {
|
|
|
|
@ -54,7 +49,7 @@ pub struct JmdictGlossary {
|
|
|
|
|
#[serde(deserialize_with = "lang_default_eng")]
|
|
|
|
|
pub language: LanguageCode,
|
|
|
|
|
// Always empty with latest version of JMdict
|
|
|
|
|
#[serde(default, skip_serializing, deserialize_with = "err_if_not_null")]
|
|
|
|
|
#[serde(default, skip_serializing, deserialize_with = "err_if_not_blank")]
|
|
|
|
|
gender: serde::de::IgnoredAny,
|
|
|
|
|
pub r#type: Option<JmdictGlossaryType>,
|
|
|
|
|
}
|
|
|
|
@ -87,7 +82,7 @@ pub struct JmdictKanji {
|
|
|
|
|
pub struct JmdictReading {
|
|
|
|
|
pub reading: String,
|
|
|
|
|
// Always empty with latest version of JMdict
|
|
|
|
|
#[serde(default, skip_serializing, deserialize_with = "err_if_not_null")]
|
|
|
|
|
#[serde(default, skip_serializing, deserialize_with = "err_if_not_blank")]
|
|
|
|
|
no_kanji: serde::de::IgnoredAny,
|
|
|
|
|
#[serde(deserialize_with = "nullable_list")]
|
|
|
|
|
pub restrictions: Vec<String>,
|
|
|
|
|