Coverage for src/wiktextract/extractor/en/type_utils.py: 100%
146 statements
« prev ^ index » next coverage.py v7.6.10, created at 2024-12-27 08:07 +0000
« prev ^ index » next coverage.py v7.6.10, created at 2024-12-27 08:07 +0000
1from typing import (
2 Sequence,
3 TypedDict,
4 Union,
5)
7from wikitextprocessor.core import TemplateArgs
10class AltOf(TypedDict, total=False):
11 word: str
12 extra: str
15class LinkageData(TypedDict, total=False):
16 alt: str
17 english: str
18 extra: str
19 qualifier: str
20 roman: str
21 ruby: Union[list[Sequence[str]], list[tuple[str, str]]]
22 sense: str
23 source: str
24 tags: list[str]
25 taxonomic: str
26 topics: list[str]
27 urls: list[str]
28 word: str
31class ExampleData(TypedDict, total=False):
32 english: str
33 note: str
34 ref: str
35 roman: str
36 ruby: Union[list[tuple[str, str]], list[Sequence[str]]]
37 text: str
38 type: str
39 literal_meaning: str
40 tags: list[str]
41 raw_tags: list[str]
44class FormOf(TypedDict, total=False):
45 word: str
46 extra: str
47 roman: str
50LinkData = list[Sequence[str]]
53class PlusObjTemplateData(TypedDict, total=False):
54 tags: list[str]
55 words: list[str]
56 meaning: str
59ExtraTemplateData = Union[PlusObjTemplateData]
62class TemplateData(TypedDict, total=False):
63 args: TemplateArgs
64 expansion: str
65 name: str
66 extra_data: ExtraTemplateData
69class DescendantData(TypedDict, total=False):
70 depth: int
71 tags: list[str]
72 templates: list[TemplateData]
73 text: str
76class FormData(TypedDict, total=False):
77 form: str
78 head_nr: int
79 ipa: str
80 roman: str
81 ruby: Union[list[tuple[str, str]], list[Sequence[str]]]
82 source: str
83 tags: list[str]
84 raw_tags: list[str]
85 topics: list[str]
88SoundData = TypedDict(
89 "SoundData",
90 {
91 "audio": str,
92 "audio-ipa": str,
93 "enpr": str,
94 "form": str,
95 "hangeul": str,
96 "homophone": str,
97 "ipa": str,
98 "mp3_url": str,
99 "note": str,
100 "ogg_url": str,
101 "other": str,
102 "rhymes": str,
103 "tags": list[str],
104 "text": str,
105 "topics": list[str],
106 "zh-pron": str,
107 },
108 total=False,
109)
112class TranslationData(TypedDict, total=False):
113 alt: str
114 code: str
115 english: str
116 lang: str
117 note: str
118 roman: str
119 sense: str
120 tags: list[str]
121 taxonomic: str
122 topics: list[str]
123 word: str
126# Xxyzz's East Asian etymology example data
127class EtymologyExample(TypedDict, total=False):
128 english: str
129 raw_tags: list[str]
130 ref: str
131 roman: str
132 tags: list[str]
133 text: str
134 type: str
137class SenseData(TypedDict, total=False):
138 alt_of: list[AltOf]
139 antonyms: list[LinkageData]
140 categories: list[str]
141 compound_of: list[AltOf]
142 coordinate_terms: list[LinkageData]
143 examples: list[ExampleData]
144 form_of: list[FormOf]
145 glosses: list[str]
146 head_nr: int
147 holonyms: list[LinkageData]
148 hypernyms: list[LinkageData]
149 hyponyms: list[LinkageData]
150 instances: list[LinkageData]
151 links: list[LinkData]
152 meronyms: list[LinkageData]
153 qualifier: str
154 raw_glosses: list[str]
155 related: list[LinkageData]
156 senseid: list[str]
157 synonyms: list[LinkageData]
158 tags: list[str]
159 taxonomic: str
160 topics: list[str]
161 wikidata: list[str]
162 wikipedia: list[str]
165class WordData(TypedDict, total=False):
166 abbreviations: list[LinkageData]
167 alt_of: list[AltOf]
168 antonyms: list[LinkageData]
169 categories: list[str]
170 coordinate_terms: list[LinkageData]
171 derived: list[LinkageData]
172 descendants: list[DescendantData]
173 etymology_examples: list[EtymologyExample]
174 etymology_number: int
175 etymology_templates: list[TemplateData]
176 etymology_text: str
177 form_of: list[FormOf]
178 forms: list[FormData]
179 head_templates: list[TemplateData]
180 holonyms: list[LinkageData]
181 hyphenation: list[str]
182 hypernyms: list[LinkageData]
183 hyponyms: list[LinkageData]
184 inflection_templates: list[TemplateData]
185 info_templates: list[TemplateData]
186 instances: list[LinkageData]
187 lang: str
188 lang_code: str
189 literal_meaning: str
190 meronyms: list[LinkageData]
191 original_title: str
192 pos: str
193 proverbs: list[LinkageData]
194 redirects: list[str]
195 related: list[LinkageData]
196 senses: list[SenseData]
197 sounds: list[SoundData]
198 synonyms: list[LinkageData]
199 translations: list[TranslationData]
200 troponyms: list[LinkageData]
201 wikidata: list[str]
202 wikipedia: list[str]
203 word: str