Coverage for src/wiktextract/extractor/en/type_utils.py: 100%
137 statements
« prev ^ index » next coverage.py v7.6.4, created at 2024-10-25 10:11 +0000
« prev ^ index » next coverage.py v7.6.4, created at 2024-10-25 10:11 +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
126class SenseData(TypedDict, total=False):
127 alt_of: list[AltOf]
128 antonyms: list[LinkageData]
129 categories: list[str]
130 compound_of: list[AltOf]
131 coordinate_terms: list[LinkageData]
132 examples: list[ExampleData]
133 form_of: list[FormOf]
134 glosses: list[str]
135 head_nr: int
136 holonyms: list[LinkageData]
137 hypernyms: list[LinkageData]
138 hyponyms: list[LinkageData]
139 instances: list[LinkageData]
140 links: list[LinkData]
141 meronyms: list[LinkageData]
142 qualifier: str
143 raw_glosses: list[str]
144 related: list[LinkageData]
145 senseid: list[str]
146 synonyms: list[LinkageData]
147 tags: list[str]
148 taxonomic: str
149 topics: list[str]
150 wikidata: list[str]
151 wikipedia: list[str]
154class WordData(TypedDict, total=False):
155 abbreviations: list[LinkageData]
156 alt_of: list[AltOf]
157 antonyms: list[LinkageData]
158 categories: list[str]
159 coordinate_terms: list[LinkageData]
160 derived: list[LinkageData]
161 descendants: list[DescendantData]
162 etymology_number: int
163 etymology_templates: list[TemplateData]
164 etymology_text: str
165 form_of: list[FormOf]
166 forms: list[FormData]
167 head_templates: list[TemplateData]
168 holonyms: list[LinkageData]
169 hyphenation: list[str]
170 hypernyms: list[LinkageData]
171 hyponyms: list[LinkageData]
172 inflection_templates: list[TemplateData]
173 info_templates: list[TemplateData]
174 instances: list[LinkageData]
175 lang: str
176 lang_code: str
177 literal_meaning: str
178 meronyms: list[LinkageData]
179 original_title: str
180 pos: str
181 proverbs: list[LinkageData]
182 redirects: list[str]
183 related: list[LinkageData]
184 senses: list[SenseData]
185 sounds: list[SoundData]
186 synonyms: list[LinkageData]
187 translations: list[TranslationData]
188 troponyms: list[LinkageData]
189 wikidata: list[str]
190 wikipedia: list[str]
191 word: str