DavideViolante / gender-detection-from-name

Gender detection from first name
MIT License
14 stars 9 forks source link

Which language map order should be considered? #92

Open DavideViolante opened 2 months ago

DavideViolante commented 2 months ago

Right now the names are evaluated in this order, if no language is provided:

return (
    primaryResult ||
    trMap.get(name) ||
    deMap.get(name) ||
    frMap.get(name) ||
    esMap.get(name) ||
    enMap.get(name) ||
    itMap.get(name) ||
    'unknown'
  );

Which order should we consider? Which is more correct?

I would do this:

return (
    primaryResult ||
    enMap.get(name) ||
    itMap.get(name) ||
    esMap.get(name) ||
    frMap.get(name) ||
    deMap.get(name) ||
    trMap.get(name) ||
    'unknown'
  );