Simple Java extension to know the gender of a given first name. It consumes the http://genderize.io API.
Java
Latest commit 10b6bdc Feb 16, 2016 @irobson Merge pull request #1 from SteelPangolin/master
Add support for API keys
Permalink
Failed to load latest commit information.
src Add a test for a name with an unknown gender. Aug 19, 2015
.gitignore Add support for Genderize.io API keys. Aug 19, 2015
.travis.yml
LICENSE.txt
README.md
pom.xml

README.md

jGenderize

Client for genderize.io web service.

Simple Java extension to know the gender of a given first name.

What is the gender for "John" ?

Genderize api = GenderizeIoAPI.create();
NameGender gender = api.getGender("John");
System.out.println("John is: "+gender.getGender());
System.out.println("is John male? " + gender.isMale());
System.out.println("Who? " + gender.getName());

What about "John" in Brazil? Localization support.

Genderize api = GenderizeIoAPI.create();
NameGender gender = api.getGender("John", new Locale("pt", "BR"));
System.out.println("John is: "+gender.getGender());
System.out.println("is John male? " + gender.isMale());

Lots of names? It is sorted.

Genderize api = GenderizeIoAPI.create();
List<NameGender> genders = api.getGenders("Robson", "Marlise", "Gilmar");

Does it works with l10n too? Sure.

Genderize api = GenderizeIoAPI.create();
List<NameGender> genders = api.getGenders(new String[] {"ted", "marshall", "lilly", "robin", "barney", "melissa"}, new Locale("en", "US"));

Have a paid API key from store.genderize.io? Use it.

Genderize api = GenderizeIoAPI.create("your_api_key_here");
List<NameGender> genders = api.getGenders(new String[] {"ted", "marshall", "lilly", "robin", "barney", "melissa"}, new Locale("en", "US"));