generated from ElnuDev/rust-project
Add simple part of speech enum
This commit is contained in:
parent
0d515cdeb2
commit
d5579f16e5
1 changed files with 101 additions and 2 deletions
|
@ -1,5 +1,5 @@
|
|||
use codes_iso_639::part_2::LanguageCode;
|
||||
use serde::{Serialize, Deserialize};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use crate::serial::*;
|
||||
|
||||
|
@ -70,7 +70,7 @@ pub struct JmdictSense {
|
|||
pub restricted_readings: Option<Vec<String>>,
|
||||
pub references: Option<Vec<String>>,
|
||||
pub antonyms: Option<Vec<String>>,
|
||||
pub parts_of_speech: Option<Vec<String>>,
|
||||
pub parts_of_speech: Option<Vec<JmdictSensePartOfSpeech>>,
|
||||
pub fields: Option<Vec<String>>,
|
||||
pub misc: Option<Vec<String>>,
|
||||
pub source_languages: Option<Vec<JmdictSource>>,
|
||||
|
@ -82,6 +82,105 @@ pub struct JmdictSense {
|
|||
examples: serde::de::IgnoredAny,
|
||||
}
|
||||
|
||||
macro_rules! JmdictSensePartOfSpeech {
|
||||
{ $( $variant:ident, $description:expr ),* } => {
|
||||
#[derive(Serialize, Deserialize)]
|
||||
pub enum JmdictSensePartOfSpeech {
|
||||
$(
|
||||
#[serde(rename = $description)]
|
||||
#[doc = $description]
|
||||
$variant
|
||||
),*
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
JmdictSensePartOfSpeech! {
|
||||
Unclassified, "unclassified",
|
||||
Noun, "noun (common) (futsuumeishi)",
|
||||
NounGenative, "nouns which may take the genitive case particle 'no'",
|
||||
NounPrefix, "noun, used as a prefix",
|
||||
NounSuffix, "noun, used as a suffix",
|
||||
Expressions, "expressions (phrases, clauses, etc.)",
|
||||
AdjectiveI, "adjective (keiyoushi)",
|
||||
AdjectiveIYoiIi, "adjective (keiyoushi) - yoi/ii class",
|
||||
AdjectiveNa, "adjectival nouns or quasi-adjectives (keiyodoshi)",
|
||||
AdjectiveNaArchaicFormal, "archaic/formal form of na-adjective",
|
||||
AdjectiveTaru, "'taru' adjective",
|
||||
AdjectiveShiku, "'shiku' adjective (archaic)",
|
||||
AdjectivePreNoun, "pre-noun adjectival (rentaishi)",
|
||||
AdjectiveAuxiliary, "auxiliary adjective",
|
||||
VerbUnspecified, "verb unspecified", // e.g 得る
|
||||
VerbIchidan, "Ichidan verb",
|
||||
VerbIchidanKureru, "Ichidan verb - kureru special class",
|
||||
VerbIchidanZuru, "Ichidan verb - zuru verb (alternative form of -jiru verbs)",
|
||||
VerbSu, "su verb - precursor to the modern suru",
|
||||
VerbNidanLowerMu, "Nidan verb (lower class) with 'mu' ending (archaic)",
|
||||
VerbNidanLowerRu, "Nidan verb (lower class) with 'ru' ending (archaic)",
|
||||
VerbNidanLowerFu, "Nidan verb (lower class) with 'hu/fu' ending (archaic)",
|
||||
VerbNidanLowerGu, "Nidan verb (lower class) with 'gu' ending (archaic)",
|
||||
VerbNidanLowerYu, "Nidan verb (lower class) with 'yu' ending (archaic)",
|
||||
VerbNidanLowerDzu, "Nidan verb (lower class) with 'dzu' ending (archaic)",
|
||||
VerbNidanLowerKu, "Nidan verb (lower class) with 'ku' ending (archaic)",
|
||||
VerbNidanLowerSu, "Nidan verb (lower class) with 'su' ending (archaic)",
|
||||
VerbNidanLowerZu, "Nidan verb (lower class) with 'zu' ending (archaic)",
|
||||
VerbNidanLowerTsu, "Nidan verb (lower class) with 'tsu' ending (archaic)",
|
||||
VerbNidanLowerNu, "Nidan verb (lower class) with 'nu' ending (archaic)",
|
||||
VerbNidanLowerUWe, "Nidan verb (lower class) with 'u' ending and 'we' conjugation (archaic)",
|
||||
VerbNidanUpperFu, "Nidan verb (upper class) with 'hu/fu' ending (archaic)",
|
||||
VerbNidanUpperRu, "Nidan verb (upper class) with 'ru' ending (archaic)",
|
||||
VerbNidanUpperTsu, "Nidan verb (upper class) with 'tsu' ending (archaic)",
|
||||
VerbNidanUpperYu, "Nidan verb (upper class) with 'yu' ending (archaic)",
|
||||
VerbNidanUpperKu, "Nidan verb (upper class) with 'ku' ending (archaic)",
|
||||
VerbNidanUpperGu, "Nidan verb (upper class) with 'gu' ending (archaic)",
|
||||
VerbNidanUpperBu, "Nidan verb (upper class) with 'bu' ending (archaic)",
|
||||
VerbNidanU, "Nidan verb with 'u' ending (archaic)",
|
||||
VerbGodanU, "Godan verb with 'u' ending",
|
||||
VerbGodanUSpecial, "Godan verb with 'u' ending (special class)",
|
||||
VerbGodanSu, "Godan verb with 'su' ending",
|
||||
VerbGodanKu, "Godan verb with 'ku' ending",
|
||||
VerbGodanRu, "Godan verb with 'ru' ending",
|
||||
VerbGodanRuIrregular, "Godan verb with 'ru' ending (irregular verb)", // e.g. ある
|
||||
VerbGodanMu, "Godan verb with 'mu' ending",
|
||||
VerbGodanGu, "Godan verb with 'gu' ending",
|
||||
VerbGodanTsu, "Godan verb with 'tsu' ending",
|
||||
VerbGodanBu, "Godan verb with 'bu' ending",
|
||||
VerbGodanNu, "Godan verb with 'nu' ending",
|
||||
VerbGodanAru, "Godan verb - -aru special class", // e.g. いらっしゃる
|
||||
VerbGodanIkuYuku, "Godan verb - Iku/Yuku special class",
|
||||
VerbNuIrregular, "irregular nu verb", // e.g. 死ぬ
|
||||
VerbKu, "'ku' adjective (archaic)",
|
||||
VerbYodanRu, "Yodan verb with 'ru' ending (archaic)",
|
||||
VerbYodanMu, "Yodan verb with 'mu' ending (archaic)",
|
||||
VerbYodanSu, "Yodan verb with 'su' ending (archaic)",
|
||||
VerbYodanKu, "Yodan verb with 'ku' ending (archaic)",
|
||||
VerbYodanFu, "Yodan verb with 'hu/fu' ending (archaic)",
|
||||
VerbYodanTsu, "Yodan verb with 'tsu' ending (archaic)",
|
||||
VerbYodanGu, "Yodan verb with 'gu' ending (archaic)",
|
||||
VerbYodanBu, "Yodan verb with 'bu' ending (archaic)",
|
||||
VerbAuxiliary, "auxiliary verb",
|
||||
VerbTransitive, "transitive verb",
|
||||
VerbIntransitive, "intransitive verb",
|
||||
VerbSuru, "suru verb - special class",
|
||||
VerbSuruNoun, "noun or participle which takes the aux. verb suru",
|
||||
VerbSuruIncluded, "suru verb - included",
|
||||
VerbKuru, "Kuru verb - special class",
|
||||
VerbRuIrregularRi, "irregular ru verb, plain form ends with -ri", // なり
|
||||
Pronoun, "pronoun",
|
||||
Adverb, "adverb (fukushi)",
|
||||
AdverbTo, "adverb taking the 'to' particle",
|
||||
Interjection, "interjection (kandoushi)",
|
||||
Prenominal, "noun or verb acting prenominally", // e.g. ええ
|
||||
Conjunction, "conjunction",
|
||||
Particle, "particle",
|
||||
Auxiliary, "auxiliary",
|
||||
Copula, "copula", // である
|
||||
Prefix, "prefix",
|
||||
Suffix, "suffix",
|
||||
Counter, "counter",
|
||||
Numeric, "numeric"
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize)]
|
||||
#[serde(rename_all(deserialize = "PascalCase"), deny_unknown_fields)]
|
||||
pub struct JmdictSource {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue