aabishkaryal / aabishkaryal/nepal-districts

[ Discussion ]: prevent user from typing mis-matched name of districts

Abierto
#18 7 comentarios 1 reacción 0 asignados Ver en GitHub
discussion
Lenguaje dominante
TypeScript
Estrellas
35
Forks
17
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

**This problem cannot be fixed by allowing user to create PR for possible "Typo" of district name.**

**Example:**
- Tehrathum -> comes from [Wiki](https://en.wikipedia.org/wiki/Tehrathum_District)
- Terhathum -> Might come from locals of that district and depends on how they spell it using Roman Nepali

For now, all the PR that fixes the typo should be checked against if it matches the name on Wiki page & we have different name on our data source.

### The future enhancement:

I was thinking of something like creating a validation notice on input field that validates the input data to "look a like" with one of the data we have on our source.

**Example of this feature:**
- Tehrathum -> The one we have on the data source
- Terhathum -> The one user might type / expect

The input validation should check if `Terhathum` ( the user input ) has similar word on our data source.

If the matching ratio is higher, suggest the word in error message with the word we have on data source:
> "Did you mean "Tehrathum" ?

### Reference
Check [Levenshtein Distance Algorithm](https://en.wikipedia.org/wiki/Levenshtein_distance) for the implementation.

This issue is open for discussion, please add your comments & suggestions.

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.