Coverage for src / wiktextract / extractor / pl / models.py: 100%
97 statements
« prev ^ index » next coverage.py v7.13.0, created at 2025-12-12 08:09 +0000
« prev ^ index » next coverage.py v7.13.0, created at 2025-12-12 08:09 +0000
1from pydantic import BaseModel, ConfigDict, Field
4class PolishBaseModel(BaseModel):
5 model_config = ConfigDict(
6 extra="forbid",
7 strict=True,
8 validate_assignment=True,
9 validate_default=True,
10 )
13class Example(PolishBaseModel):
14 text: str = ""
15 bold_text_offsets: list[tuple[int, int]] = []
16 translation: str = ""
17 bold_translation_offsets: list[tuple[int, int]] = []
18 ref: str = ""
19 roman: str = ""
20 literal_meaning: str = ""
23class AltForm(PolishBaseModel):
24 word: str
27class Attestation(PolishBaseModel):
28 date: str
31class Sense(PolishBaseModel):
32 glosses: list[str] = []
33 tags: list[str] = []
34 raw_tags: list[str] = []
35 topics: list[str] = []
36 categories: list[str] = []
37 sense_index: str = ""
38 examples: list[Example] = []
39 alt_of: list[AltForm] = []
40 form_of: list[AltForm] = []
41 notes: list[str] = []
42 attestations: list[Attestation] = []
45class Translation(PolishBaseModel):
46 lang_code: str = ""
47 lang: str = ""
48 word: str = ""
49 sense_index: str = ""
50 tags: list[str] = []
51 raw_tags: list[str] = []
52 roman: str = ""
53 ruby: list[tuple[str, ...]] = []
56class Sound(PolishBaseModel):
57 zh_pron: str = Field(default="", description="Chinese word pronunciation")
58 ipa: str = Field(default="", description="International Phonetic Alphabet")
59 audio: str = Field(default="", description="Audio file name")
60 wav_url: str = ""
61 oga_url: str = ""
62 ogg_url: str = ""
63 mp3_url: str = ""
64 opus_url: str = ""
65 flac_url: str = ""
66 tags: list[str] = []
67 raw_tags: list[str] = []
68 homophone: str = ""
69 sense_index: str = ""
72class Linkage(PolishBaseModel):
73 word: str
74 tags: list[str] = []
75 raw_tags: list[str] = []
76 sense_index: str = ""
77 topics: list[str] = []
78 furigana: str = ""
79 translation: str = ""
82class Form(PolishBaseModel):
83 form: str = ""
84 tags: list[str] = []
85 raw_tags: list[str] = []
86 sense_index: str = ""
89class Note(PolishBaseModel):
90 sense_index: str = ""
91 text: str = Field(min_length=1)
94class Hyphenation(PolishBaseModel):
95 parts: list[str] = []
96 tags: list[str] = []
97 raw_tags: list[str] = []
100class WordEntry(PolishBaseModel):
101 model_config = ConfigDict(title="Polish Wiktionary")
103 word: str = Field(description="Word string", min_length=1)
104 lang_code: str = Field(description="Wiktionary language code", min_length=1)
105 lang: str = Field(description="Localized language name", min_length=1)
106 pos: str = Field(description="Part of speech type", min_length=1)
107 pos_title: str = ""
108 senses: list[Sense] = []
109 title: str = Field(default="", description="Redirect page source title")
110 redirect: str = Field(default="", description="Redirect page target title")
111 categories: list[str] = []
112 tags: list[str] = []
113 raw_tags: list[str] = []
114 etymology_texts: list[str] = []
115 translations: list[Translation] = []
116 sounds: list[Sound] = []
117 antonyms: list[Linkage] = []
118 hypernyms: list[Linkage] = []
119 hyponyms: list[Linkage] = []
120 holonyms: list[Linkage] = []
121 meronyms: list[Linkage] = []
122 related: list[Linkage] = []
123 proverbs: list[Linkage] = []
124 synonyms: list[Linkage] = []
125 derived: list[Linkage] = []
126 forms: list[Form] = []
127 hyphenations: list[Hyphenation] = []