diff options
| author | FotoVerite <[email protected]> | 2014-02-19 12:34:02 -0500 |
|---|---|---|
| committer | FotoVerite <[email protected]> | 2014-02-19 12:34:02 -0500 |
| commit | 791ca874dda88acaed7c3ad0c681dd5013083953 (patch) | |
| tree | 29dc866c7dac33a1b82314a3f5ea8e0ec4b3c7bb /scripts | |
| parent | 120ee510f1d64b2e52ac599d4596b32fc1287de4 (diff) | |
| download | faker-791ca874dda88acaed7c3ad0c681dd5013083953.tar.xz faker-791ca874dda88acaed7c3ad0c681dd5013083953.zip | |
Removes gender. Score 1 for non binary fake data.
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/import.js | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/scripts/import.js b/scripts/import.js new file mode 100644 index 00000000..e2a3ba11 --- /dev/null +++ b/scripts/import.js @@ -0,0 +1,23 @@ +var fs = require( "fs" ); + +function importNames( inputFile, outputFile ) { + var input = fs.readFileSync( __dirname + "/" + inputFile ), + names = String( input ).split( "\n" ), + output; + + names = names + .map( function( name ) { + name = name.trim(); + name = name.charAt( 0 ).toUpperCase() + name.substr( 1 ).toLowerCase(); + return name; + }).filter( function( name ) { + return name !== ""; + }); + + output = "module.exports = [ '" + names.join( "', '" ) + "' ];"; + + fs.writeFileSync( __dirname + "/" + outputFile, output ); +} + +importNames( "../data/male-names.txt", "../lib/male_names.js" ); +importNames( "../data/female-names.txt", "../lib/female_names.js" );
\ No newline at end of file |
