Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Terrible file format of nam_dict.txt #4

Closed
gvojtko opened this issue Mar 31, 2021 · 1 comment
Closed

Terrible file format of nam_dict.txt #4

gvojtko opened this issue Mar 31, 2021 · 1 comment

Comments

@gvojtko
Copy link

gvojtko commented Mar 31, 2021

The file format and data entry method is not applicable for any name extension. Using spaces between characters is a bad way. For each name, it is necessary to calculate the number of spaces and at the same time monitor for which country I am entering data. It would be useful to use a file and template in csv, xml, json, yaml or other file format, which will allow you to clearly define names and countries.

@tuqqu
Copy link
Owner

tuqqu commented Apr 11, 2021

Hello! Thanks for taking interest in this library.

The nam_dict.txt file format is not ideal and rather odd, that's true, it comes from the original gender.c program written in I believe 2007.

I do not really see a point in supporting various file formats, as this library was basically built as a wrapper for the contents of this nam_dict.txt file. Adding an option to add a custom dictionary file was trivial, so I implemented it.

There are similar libraries in other languages e.g. in ruby, in python that share the "file wrapper library" concept. I believe there are others as well.

Thus, apart from adding complexity and dependencies (not all formats are natively supported by php), adding this option would present the whole package as a general purpose gender detecting tool to use in pair with some kind of data-providers (who would create them?), which it really isn't.

@tuqqu tuqqu closed this as completed May 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants