Skip to content

Commit

Permalink
Remove unused code for Chinese Wiktionary from English extractor
Browse files Browse the repository at this point in the history
  • Loading branch information
xxyzz committed Nov 28, 2023
1 parent ba2492e commit 07a5c2f
Showing 1 changed file with 0 additions and 24 deletions.
24 changes: 0 additions & 24 deletions src/wiktextract/extractor/en/page.py
Original file line number Diff line number Diff line change
Expand Up @@ -1470,9 +1470,6 @@ def sense_template_fn(
v = v.strip()
if v and "<" not in v:
gloss_template_args.add(v)
if wxr.config.dump_file_lang_code == "zh":
add_form_of_tags(wxr, name,
wxr.config.FORM_OF_TEMPLATES, sense_base)
return None

def extract_link_texts(item):
Expand Down Expand Up @@ -3596,24 +3593,3 @@ def multitrans_post_fn(name, ht, text):
)
x["original_title"] = word
return ret


def add_form_of_tags(wxr, template_name, form_of_templates, sense_data):
# https://en.wiktionary.org/wiki/Category:Form-of_templates
if template_name in form_of_templates:
data_append(sense_data, "tags", "form-of")

if template_name in ("abbreviation of", "abbr of"):
data_append(sense_data, "tags", "abbreviation")
elif template_name.startswith(("alt ", "alternative")):
data_append(sense_data, "tags", "alt-of")
elif template_name.startswith(("female", "feminine")):
data_append(sense_data, "tags", "feminine")
elif template_name == "initialism of":
data_extend(sense_data, "tags", ["abbreviation", "initialism"])
elif template_name.startswith("masculine"):
data_append(sense_data, "tags", "masculine")
elif template_name.startswith("misspelling"):
data_append(sense_data, "tags", "misspelling")
elif template_name.startswith(("obsolete", "obs ")):
data_append(sense_data, "tags", "obsolete")

0 comments on commit 07a5c2f

Please sign in to comment.