Upload 2 files
Browse files- 153_toponimos_atestiguados.csv.gz +3 -0
- app.py +11 -12
153_toponimos_atestiguados.csv.gz
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9a70a00347f78a55c73dff59597fbe2777f48e908c0d6c93301abf37afd040b5
|
| 3 |
+
size 1189
|
app.py
CHANGED
|
@@ -51,7 +51,6 @@ def _cand(*names):
|
|
| 51 |
|
| 52 |
# Prioriza los "master/surface-ready"; luego retrocompatibles
|
| 53 |
CSV_BI = _cand(
|
| 54 |
-
"LEXICON_v152_IBERIAN.csv.gz",
|
| 55 |
"LEXICON_v86_IBERIAN.csv.gz",
|
| 56 |
"LEXICON_v85_IBERIAN.csv.gz",
|
| 57 |
"LEXICON_v84_IBERIAN.csv.gz",
|
|
@@ -1961,7 +1960,7 @@ _register_ipfv_3s_reverse()
|
|
| 1961 |
# Coste medido: ~6 s al arranque (3 ejecuciones: 5.5, 5.5, 7.4 s). Una
|
| 1962 |
# sola pasada al final, no afecta el bucle interno de override. Corrige
|
| 1963 |
# ~328K entradas NI2ES (verificado en lex actual con 129 parches).
|
| 1964 |
-
VERSION_MARKER = "
|
| 1965 |
try:
|
| 1966 |
print(f"[Neoíbero translator] versión cargada: {VERSION_MARKER}", flush=True)
|
| 1967 |
print(f"[Neoíbero translator] léxico activo: {CSV_BI}", flush=True)
|
|
@@ -2326,24 +2325,24 @@ def translate_es_to_ni_bi(text:str):
|
|
| 2326 |
break
|
| 2327 |
|
| 2328 |
key = lower(t)
|
| 2329 |
-
#
|
| 2330 |
-
#
|
| 2331 |
-
#
|
| 2332 |
-
#
|
| 2333 |
-
#
|
| 2334 |
-
#
|
| 2335 |
-
#
|
| 2336 |
key_in_lex = key in ES2NI or fold(key) in ES_FOLD
|
| 2337 |
is_proper_noun = (
|
| 2338 |
len(t) >= 2
|
| 2339 |
and t[0].isupper()
|
| 2340 |
and not t.isupper()
|
| 2341 |
and t.isalpha()
|
| 2342 |
-
and
|
| 2343 |
)
|
| 2344 |
if is_proper_noun:
|
| 2345 |
-
|
| 2346 |
-
out.append(
|
| 2347 |
prev_key = key
|
| 2348 |
left_context.append(t)
|
| 2349 |
i += 1
|
|
|
|
| 51 |
|
| 52 |
# Prioriza los "master/surface-ready"; luego retrocompatibles
|
| 53 |
CSV_BI = _cand(
|
|
|
|
| 54 |
"LEXICON_v86_IBERIAN.csv.gz",
|
| 55 |
"LEXICON_v85_IBERIAN.csv.gz",
|
| 56 |
"LEXICON_v84_IBERIAN.csv.gz",
|
|
|
|
| 1960 |
# Coste medido: ~6 s al arranque (3 ejecuciones: 5.5, 5.5, 7.4 s). Una
|
| 1961 |
# sola pasada al final, no afecta el bucle interno de override. Corrige
|
| 1962 |
# ~328K entradas NI2ES (verificado en lex actual con 129 parches).
|
| 1963 |
+
VERSION_MARKER = "v138_2026_05_19_propios_sin_corchete"
|
| 1964 |
try:
|
| 1965 |
print(f"[Neoíbero translator] versión cargada: {VERSION_MARKER}", flush=True)
|
| 1966 |
print(f"[Neoíbero translator] léxico activo: {CSV_BI}", flush=True)
|
|
|
|
| 2325 |
break
|
| 2326 |
|
| 2327 |
key = lower(t)
|
| 2328 |
+
# v104: detectar NOMBRE PROPIO / TOPÓNIMO NO ATESTIGUADO.
|
| 2329 |
+
# Si la palabra capitalizada NO está en el lex, devolverla TAL CUAL
|
| 2330 |
+
# (sin corchete), porque puede ser un nombre propio (Ana, Marco) o
|
| 2331 |
+
# un topónimo no atestiguado (Madrid, Valencia). El lex contiene
|
| 2332 |
+
# solo topónimos atestiguados, así que si está en el lex, se traduce.
|
| 2333 |
+
# Para casos de inicio de oración con palabra en lex (típico inicio
|
| 2334 |
+
# normal: "Te escribo..."), siempre traducir.
|
| 2335 |
key_in_lex = key in ES2NI or fold(key) in ES_FOLD
|
| 2336 |
is_proper_noun = (
|
| 2337 |
len(t) >= 2
|
| 2338 |
and t[0].isupper()
|
| 2339 |
and not t.isupper()
|
| 2340 |
and t.isalpha()
|
| 2341 |
+
and not key_in_lex # SOLO si NO está en el lex
|
| 2342 |
)
|
| 2343 |
if is_proper_noun:
|
| 2344 |
+
# v104: devolver tal cual SIN corchete (era "[t]" antes)
|
| 2345 |
+
out.append(t); ib_toks.append(t)
|
| 2346 |
prev_key = key
|
| 2347 |
left_context.append(t)
|
| 2348 |
i += 1
|