knowbee / rwanda

🇷🇼This is a simple npm package that returns provinces, districts, sectors, villages and cells from Rwanda
https://www.npmjs.com/package/rwanda
MIT License
47 stars 20 forks source link

Handle Case Sensitivity of Inputs with One or Two Words #19

Closed YvesIraguha closed 3 years ago

YvesIraguha commented 3 years ago

What does this PR do?

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:

[
  "Nyamata y' Umujyi", 'Rugarama I',
  'Rugarama II',       'Rukomo II',
  'Rukiri I',          'Rukiri II',
  'Kabuga I',          'Kabuga II',
  'Munanira I',        'Munanira II',
  'Nyakabanda I',      'Nyakabanda II',
  'Kabuguru I',        'Kabuguru II',
  'Rwezamenyo I',      'Rwezamenyo II',
  'Rango A',           'Rango B'
] 

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.

knowbee commented 3 years ago

Thanks for the PR