Skip to content

Commit

Permalink
[zh] fix TypeError: unhashable type: 'list' exception
Browse files Browse the repository at this point in the history
in page "提比里斯", wikitext: "{{trans-see|喬治亞/格魯吉亞首都|第比利
斯#翻譯{{!}}第比利斯}}"
  • Loading branch information
xxyzz committed Dec 23, 2024
1 parent d8cb2f3 commit 63373d9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
5 changes: 1 addition & 4 deletions src/wiktextract/extractor/zh/section_titles.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@

POS_TITLES: dict[str, POSSubtitleData] = {
"不及物动词": {"pos": "verb", "tags": ["intransitive"]},
"不及物動詞": {
"pos": "verb",
"tags": ["intransitive"]
},
"不及物動詞": {"pos": "verb", "tags": ["intransitive"]},
"不定代词": {"pos": "pron"},
"不定冠詞": {"pos": "article"},
"不定冠词": {"pos": "article"},
Expand Down
6 changes: 5 additions & 1 deletion src/wiktextract/extractor/zh/translation.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,11 @@ def translation_subpage(
target_section = None
if template_node.template_name == "see translation subpage":
target_section = template_node.template_parameters.get(1)
page_title = template_node.template_parameters.get(2, wxr.wtp.title)
page_title = clean_node(
wxr, None, template_node.template_parameters.get(2, wxr.wtp.title)
)
if "#" in page_title:
page_title = page_title[:page_title.index("#")]

translation_subpage_title = page_title
if page_title == wxr.wtp.title:
Expand Down

0 comments on commit 63373d9

Please sign in to comment.