Skip to content

Commit

Permalink
Change French JSON example "source" key to "ref"
Browse files Browse the repository at this point in the history
  • Loading branch information
xxyzz committed Oct 10, 2023
1 parent 1a64e45 commit fd11622
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
8 changes: 7 additions & 1 deletion json_schema/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,12 @@
"redirect": {
"description": "Redirect page target title",
"type": "string"
},
"categories": {
"type": "array",
"items": {
"type": "string"
}
}
},
"$defs": {
Expand Down Expand Up @@ -178,7 +184,7 @@
"description": "Romanization of the example sentence",
"type": "string"
},
"source": {
"ref": {
"description": "Source of the sentence, like book title and page number",
"type": "string"
},
Expand Down
4 changes: 2 additions & 2 deletions tests/test_fr_gloss.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def test_example_template(self):
"text": "text",
"translation": "translation",
"roman": "roman",
"source": "source",
"ref": "source",
"type": "quotation",
}
],
Expand Down Expand Up @@ -104,7 +104,7 @@ def test_example_source_template(self, mock_node_to_html):
"examples": [
{
"text": "example",
"source": "source_title",
"ref": "source_title",
"type": "quotation",
}
],
Expand Down
4 changes: 2 additions & 2 deletions wiktextract/extractor/fr/gloss.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def extract_examples(
example_data = {"type": "example"}
example_data["text"] = clean_node(wxr, None, example_nodes)
if source_template is not None:
example_data["source"] = clean_node(
example_data["ref"] = clean_node(
wxr, None, source_template
).strip("— ()")
example_data["type"] = "quotation"
Expand Down Expand Up @@ -125,7 +125,7 @@ def process_exemple_template(
if len(transcription) > 0:
example_data["roman"] = clean_node(wxr, None, transcription)
if len(source) > 0:
example_data["source"] = clean_node(wxr, None, source)
example_data["ref"] = clean_node(wxr, None, source)
example_data["type"] = "quotation"
if "text" in example_data:
gloss_data["examples"].append(example_data)

0 comments on commit fd11622

Please sign in to comment.