Upload 2 files
Browse files- 170_bases_sustantivas.csv.gz +3 -0
- app.py +26 -1
170_bases_sustantivas.csv.gz
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:96b59ef68b7fa412b7a635bdc574ed2d151272acf7bcde15a4f559ead5c71845
|
| 3 |
+
size 361
|
app.py
CHANGED
|
@@ -1532,6 +1532,31 @@ def apply_lex_patches():
|
|
| 1532 |
# replica el comportamiento de carga del CSV base para
|
| 1533 |
# palabras ambiguas como "despierto" (ADJ + V/PRS-1S).
|
| 1534 |
old_pos = ES2NI_POS.get(es_l, "")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1535 |
if pos == "V" and old_pos in ("ADJ", "N") and es_l not in ES2NI_VERB:
|
| 1536 |
ES2NI_VERB[es_l] = (ni, pid)
|
| 1537 |
# v109: si NI2ES apunta a la forma SIN diptongar
|
|
@@ -1988,7 +2013,7 @@ _register_ipfv_3s_reverse()
|
|
| 1988 |
# Coste medido: ~6 s al arranque (3 ejecuciones: 5.5, 5.5, 7.4 s). Una
|
| 1989 |
# sola pasada al final, no afecta el bucle interno de override. Corrige
|
| 1990 |
# ~328K entradas NI2ES (verificado en lex actual con 129 parches).
|
| 1991 |
-
VERSION_MARKER = "
|
| 1992 |
try:
|
| 1993 |
print(f"[Neoíbero translator] versión cargada: {VERSION_MARKER}", flush=True)
|
| 1994 |
print(f"[Neoíbero translator] léxico activo: {CSV_BI}", flush=True)
|
|
|
|
| 1532 |
# replica el comportamiento de carga del CSV base para
|
| 1533 |
# palabras ambiguas como "despierto" (ADJ + V/PRS-1S).
|
| 1534 |
old_pos = ES2NI_POS.get(es_l, "")
|
| 1535 |
+
# v144 (este patch): caso inverso — el nuevo es N/ADJ y el
|
| 1536 |
+
# existente es V. Algunos sustantivos comunes solo entraron
|
| 1537 |
+
# al lex como conjugación verbal homógrafa (ej. "bala" como
|
| 1538 |
+
# darsitok-ke = balar PRS-3S). Aquí promovemos el sustantivo
|
| 1539 |
+
# a ES2NI (default contextual) y preservamos la verbal en
|
| 1540 |
+
# ES2NI_VERB. El motor de traducción elige por contexto
|
| 1541 |
+
# (NOUN_CTX → sustantivo, VERB_CTX → verbo).
|
| 1542 |
+
if pos in ("N", "ADJ") and old_pos == "V" and es_l not in ES2NI_VERB:
|
| 1543 |
+
# Mover la verbal existente a ES2NI_VERB
|
| 1544 |
+
ES2NI_VERB[es_l] = ES2NI[es_l]
|
| 1545 |
+
# Promover la nueva entrada como principal
|
| 1546 |
+
ni_already = ni_l in NI2ES
|
| 1547 |
+
ES2NI[es_l] = (ni, pid)
|
| 1548 |
+
ES2NI_POS[es_l] = pos
|
| 1549 |
+
if morph: ES2NI_MORPH[es_l] = morph
|
| 1550 |
+
if not ni_already:
|
| 1551 |
+
NI2ES[ni_l] = (es, pid)
|
| 1552 |
+
if " " in es_l and es_l not in ESPHRASE2NI:
|
| 1553 |
+
ESPHRASE2NI[es_l] = (ni, pid)
|
| 1554 |
+
if " " in ni_l and ni_l not in NIPHRASE2ES and not ni_already:
|
| 1555 |
+
NIPHRASE2ES[ni_l] = (es, pid)
|
| 1556 |
+
ops["add"] += 1
|
| 1557 |
+
LEX_PATCH_LOG.append((patch_name, op, es, ni, "ok",
|
| 1558 |
+
f"{pos} promovido (verbal preservado en ES2NI_VERB)"))
|
| 1559 |
+
continue
|
| 1560 |
if pos == "V" and old_pos in ("ADJ", "N") and es_l not in ES2NI_VERB:
|
| 1561 |
ES2NI_VERB[es_l] = (ni, pid)
|
| 1562 |
# v109: si NI2ES apunta a la forma SIN diptongar
|
|
|
|
| 2013 |
# Coste medido: ~6 s al arranque (3 ejecuciones: 5.5, 5.5, 7.4 s). Una
|
| 2014 |
# sola pasada al final, no afecta el bucle interno de override. Corrige
|
| 2015 |
# ~328K entradas NI2ES (verificado en lex actual con 129 parches).
|
| 2016 |
+
VERSION_MARKER = "v144_2026_05_20_add_promote_N_over_V"
|
| 2017 |
try:
|
| 2018 |
print(f"[Neoíbero translator] versión cargada: {VERSION_MARKER}", flush=True)
|
| 2019 |
print(f"[Neoíbero translator] léxico activo: {CSV_BI}", flush=True)
|