1 /* The person who associated a work with this deed has dedicated the
2 work to the public domain by waiving all of his or her rights to
3 the work worldwide under copyright law, including all related and
4 neighboring rights, to the extent allowed by law.
6 You can copy, modify, distribute and perform the work, even for
7 commercial purposes, all without asking permission.
9 See https://creativecommons.org/publicdomain/zero/1.0/ for details.
480 function capitalize (s
) {
481 return s
.split(" ").map(function (s
) {
482 return s
[0].toUpperCase() + s
.slice(1).toLowerCase();
486 function consonant (b
) {
487 var a
= this.replace(/C
/g
, 'K')
489 .replace(/[^A-Z]+/g, ' ')
490 .trimRight().split(/ +/g
);
491 var b
= b
.replace(/C
/g
, 'K')
493 .replace(/[^A-Z]+/g, ' ')
494 .trimRight().split(/ +/g
);
495 return intersects(a
, b
);
498 function generateName () {
499 var location
= choice(LOCATION
);
500 var denizen
= capitalize(choice(
501 DENIZEN
.filter(consonant
, location
)));
502 var adjective
= capitalize(choice(
503 ADJECTIVE
.filter(consonant
, location
)));
504 var state
= capitalize(choice(
505 STATE
.filter(consonant
, location
)));
506 location
= capitalize(location
);
508 ["The", denizen
+ "'s", location
],
509 ["The", adjective
, location
],
510 ["The", location
, "of", state
],
511 [state
+ "'s", location
],
512 ["The", location
, "of", "the", denizen
],
514 [capitalize(choice(ADJECTIVE
)), denizen
, location
],
515 [adjective
, denizen
, capitalize(choice(LOCATION
))],