Repository navigation
fix(glosario): mayúsculas de palabras comunes y vecindad en misiones JSON #41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Consterna
wants to merge
3
commits into
main
Choose a base branch
from
fix/detalles-finales
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| """Una palabra suelta de un mod que el español escribe en minúscula no recibe mayúscula a mitad de frase.""" | ||
|
|
||
| from __future__ import annotations | ||
|
|
||
| from traductor_es.motores.base import Lote | ||
| from traductor_es.nucleo.glosario import Glosario | ||
| from traductor_es.nucleo.memoria import Memoria | ||
| from traductor_es.nucleo.traductor import Traductor | ||
|
|
||
|
|
||
| class _Fijo: | ||
| nombre = "fijo" | ||
|
|
||
| def __init__(self, salida: dict[str, str]) -> None: | ||
| self.salida = salida | ||
|
|
||
| def traducir_lote(self, lote: Lote) -> dict[str, str]: | ||
| return {e.id: self.salida[e.texto] for e in lote.entradas} | ||
|
|
||
|
|
||
| def _glosario() -> Glosario: | ||
| g = Glosario() | ||
| g.agregar_pares({"a": "Gear", "b": "Arcanite"}, {"a": "Engranaje", "b": "Arcanita"}, fuente="mod") | ||
| g.aprender_usos({"z": "Craft a gear"}, {"z": "Fabrica un engranaje"}) # el español lo escribe en minúscula | ||
| return g | ||
|
|
||
|
|
||
| def test_un_sustantivo_comun_no_recibe_mayuscula() -> None: | ||
| texto = "Put the Gear and the Arcanite in the machine" | ||
| motor = _Fijo({texto: "Pon el engranaje y la arcanita en la máquina"}) | ||
| with Memoria(":memory:") as m: | ||
| r = Traductor(motor, m, _glosario()).traducir([texto], "mision") | ||
| assert r.traducciones[texto] == "Pon el engranaje y la Arcanita en la máquina" # nombre propio del mod | ||
|
|
||
|
|
||
| def test_el_glosario_del_usuario_conserva_sus_mayusculas() -> None: | ||
| g = _glosario() | ||
| g.fijar({"Gear": "Engranaje"}) | ||
| texto = "Put the Gear in the machine" | ||
| with Memoria(":memory:") as m: | ||
| r = Traductor(_Fijo({texto: "Pon el engranaje en la máquina"}), m, g).traducir([texto], "mision") | ||
| assert r.traducciones[texto] == "Pon el Engranaje en la máquina" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When a BetterQuesting title is a translation key—the existing fixture uses
bq.quest.1.name—piezas_defilters it out, so this list has no title boundary.con_vecindadthen keeps the previous quest’s title and adds it to the next quest’s description (the fixture’s§aGreen text), potentially misleading its translation. Preserve a context reset for skipped titles.Useful? React with 👍 / 👎.