Coverage for src/wiktextract/extractor/zh/note.py: 100%
9 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 wikitextprocessor import NodeKind, WikiNode
3from wiktextract.page import clean_node
4from wiktextract.wxr_context import WiktextractContext
6from .models import WordEntry
9def extract_note(
10 wxr: WiktextractContext,
11 page_data: list[WordEntry],
12 level_node: WikiNode,
13) -> None:
14 for list_item in level_node.find_child_recursively(NodeKind.LIST_ITEM):
15 page_data[-1].notes.append(
16 clean_node(wxr, page_data[-1], list_item.children)
17 )
19 if not level_node.contain_node(NodeKind.LIST):
20 page_data[-1].notes.append(
21 clean_node(wxr, page_data[-1], level_node.children)
22 )