Fixes the issue of case sensitivity on input with one or two words
Description of Task to be completed?
if a user provides an input of kiGALi, transform it to Kigali,
if a user provides an input of rUkiRI ii, transform it to Rukiri II
if a user provides an input of ranGo a, transform it to Rango A
take the user's input, and normalize it to the shape of the data.
How should this be manually tested?
Checkout the branch and run it locally
Before these changes, calling Districts() with KIGALI or kiGaLi or different variations of Kigali except this one Kigali and this one kigali would throw an error that it can't return data of undefined or null.
Currently, different variations of input works just as imagined. This works if the input has one word or two words.
Any background context you want to provide?
I have done an analysis of the data, so far we can narrow down the data to villages of a particular cell. From the analysis I did, I realized the keys in different objects we have, which have more than one word, are these ones:
Apart from Nyamata y' Umujyi which has 3 words, others have two words. The first word is a Capitalized string, and the second word is UPPERCASE of one alphabet or more than one alphabet.
Therefore, this PR normalizes variations of any input with one or two words to ensure that case insensitivity, which is described on the READme, is handled correctly.
What does this PR do?
Description of Task to be completed?
How should this be manually tested?
KIGALI
orkiGaLi
or different variations ofKigali
except this oneKigali
and this onekigali
would throw an error that it can't return data of undefined or null.Any background context you want to provide?
I have done an analysis of the data, so far we can narrow down the data to villages of a particular cell. From the analysis I did, I realized the keys in different objects we have, which have more than one word, are these ones:
Apart from
Nyamata y' Umujyi
which has 3 words, others have two words. The first word is a Capitalized string, and the second word is UPPERCASE of one alphabet or more than one alphabet.Therefore, this PR normalizes variations of any input with one or two words to ensure that case insensitivity, which is described on the READme, is handled correctly.