def METHOD_NAME(
    wxr: WiktextractContext,
    entry: str,
    lang_code: Optional[str],
    pos: Optional[str],
    sense: Optional[str],
    linkage: Optional[str],
    term_str: str,
) -> List["ThesaurusTerm"]:
    from wiktextract.thesaurus import ThesaurusTerm
    tags = None
    roman = None
    if term_str.startswith("("):  # has qualifier
        qual_bracket_idx = term_str.find(")")
        tags = "|".join(term_str[1:qual_bracket_idx].split(", "))
        term_str = term_str[qual_bracket_idx + 2 :]
    thesaurus = []
    for term_str in term_str.split("、"):
        # Example term_str from https://zh.wiktionary.org/wiki/Thesaurus:死ぬ
        # Fromat: (qualifer) term (roman, gloss)
        # 'この世(よ)を去(さ)る (kono yo o saru, 字面意思為“to leave this world”)'
        # '若死(わかじ)にする (wakajini suru, “还年轻时死去”)'
        term_end = term_str.find(" (")
        term = term_str[:term_end]
        roman_and_gloss = term_str[term_end + 2 :].removesuffix(")").split(", ")
        if roman_and_gloss:
            roman = roman_and_gloss[0]
        thesaurus.append(
            ThesaurusTerm(
                entry=entry,
                language_code=lang_code,
                pos=pos,
                linkage=linkage,
                term=term,
                tags=tags,
                roman=roman,
                sense=sense,
            )
        )
    return thesaurus