diff --git a/src/wiktextract/extractor/es/gloss.py b/src/wiktextract/extractor/es/gloss.py index 47924a616..b8bb567c4 100644 --- a/src/wiktextract/extractor/es/gloss.py +++ b/src/wiktextract/extractor/es/gloss.py @@ -2,6 +2,7 @@ from wikitextprocessor import NodeKind, WikiNode from wikitextprocessor.parser import WikiNodeChildrenList + from wiktextract.extractor.es.models import Sense, WordEntry from wiktextract.extractor.es.sense_data import process_sense_data_list from wiktextract.page import clean_node @@ -38,7 +39,7 @@ def extract_gloss( match = re.match(r"^(\d+)", gloss_note) if match: - gloss_data.senseid = int(match.group(1)) + gloss_data.senseid = match.group(1) tag_string = gloss_note[len(match.group(1)) :].strip() else: tag_string = gloss_note.strip() diff --git a/src/wiktextract/extractor/es/models.py b/src/wiktextract/extractor/es/models.py index 838b913ce..77ed1026d 100644 --- a/src/wiktextract/extractor/es/models.py +++ b/src/wiktextract/extractor/es/models.py @@ -93,7 +93,7 @@ class Sense(BaseModelWrap): # subsenses: list["Sense"] = Field( # default=[], description="List of subsenses" # ) - senseid: Optional[int] = Field( + senseid: Optional[str] = Field( default=None, description="Sense number used in Wiktionary" ) antonyms: Optional[list[Linkage]] = [] diff --git a/tests/test_es_gloss.py b/tests/test_es_gloss.py index a22409f35..5105821ad 100644 --- a/tests/test_es_gloss.py +++ b/tests/test_es_gloss.py @@ -44,13 +44,13 @@ def test_es_extract_glosses(self): "glosses": [ "Contribuir esfuerzo o recursos para la realización de algo." ], - "senseid": 1, + "senseid": "1", }, { "glosses": [ "Por antonomasia, cooperar a que alguno salga de una situación dificultosa" ], - "senseid": 2, + "senseid": "2", }, ], ) @@ -80,7 +80,7 @@ def test_es_extract_gloss_categories(self): "glosses": [ "Sentimiento afectivo de atracción, unión y afinidad que se experimenta hacia una persona, animal o cosa" ], - "senseid": 1, + "senseid": "1", "tags": ["Humanidades"], "categories": ["ES:Sentimientos"], }