andalugeeks / andalugeeks/andaluh-py

Problem with dotless i

Abierto
#11 0 comentarios 0 reacciones 0 asignados Ver en GitHub
bug good first issue help wanted
Lenguaje dominante
Python
Estrellas
28
Forks
5
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

There is a problem when trying to transcript a word like "Cacık" that contains a special char, in this case, dotless i.

I reviewed the code where the exception raises:

```python
def replace_const_end_with_case(match):
repl_rules = {
'a': 'â', 'A': 'Â', 'á': 'â', 'Á': 'Â',
'e': 'ê', 'E': 'Ê', 'é': 'ê', 'É': 'Ê',
'i': 'î', 'I': 'Î', 'í': 'î', 'Í': 'Î',
'o': 'ô', 'O': 'Ô', 'ó': 'ô', 'Ó': 'Ô',
'u': 'û', 'U': 'Û', 'ú': 'û', 'Ú': 'Û'
}

word = match.group(0)
prefix = match.group(1)
suffix_vowel = match.group(2)
suffix_const = match.group(3)

else_cond = any(
s in prefix
for s in ('á', 'é', 'í', 'ó', 'ú', 'Á', 'É', 'Í', 'Ó', 'Ú'))

if word.lower() in list(WORDEND_CONST_RULES_EXCEPT.keys()):
return keep_case(word, WORDEND_CONST_RULES_EXCEPT[word.lower()])
elif else_cond:
return prefix + repl_rules[suffix_vowel]
else:
if suffix_const.isupper():
return prefix + repl_rules[suffix_vowel] + 'H'
else:
return prefix + repl_rules[suffix_vowel] + 'h' # <--- EXACTLY HERE
```

I think that there are two choices to solve this:

- Add more entries to the repl_rules map
- Filter out words that contain characters that are not normally used in Spanish.

I'll check other kind of chars to learn more about this problem.

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.