-
Notifications
You must be signed in to change notification settings - Fork 1
/
name_generator.js
107 lines (102 loc) · 2.82 KB
/
name_generator.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
var first =
[
"abelian",
"associative",
"computable",
"Lebesgue-measurable",
"semi-decidable",
"simple",
"combinatorial",
"structure-preserving",
"diagonalizable",
"nonsingular",
"orientable",
"twice-differentiable",
"thrice-differentiable",
"countable",
"prime",
"complete",
"continuous",
"trivial",
"3-connected",
"bipartite",
"planar",
"finite",
"nondeterministic",
"alternating",
"convex",
"undecidable",
"dihedral",
"context-free",
"rational",
"regular",
"Noetherian",
"Cauchy",
"open",
"closed",
"compact",
"clopen",
"pointless"
];
var second =
[
["multiset", "multisets", true],
["integer", "integers", false],
["metric space", "metric spaces", true],
["group", "groups", true],
["monoid", "monoids", true],
["semigroup", "semigroups", true],
["ring", "rings", true],
["field", "fields", true],
["module", "modules", true],
["Turing machine", "Turing machines", false],
["topological space", "topological spaces", true],
["automorphism", "automorphisms", false],
["bijection", "bijections", false],
["DAG", "DAGs", false],
["generating function", "generating functions", false],
["taylor series", "taylor series", false],
["Hilbert space", "Hilbert spaces", true],
["linear transformation", "linear transformations", false],
["manifold", "manifolds", true],
["hypergraph", "hypergraphs", true],
["pushdown automaton", "pushdown automata", false],
["combinatorial game", "combinatorial games", false],
["residue class", "residue classes", true],
["equivalence relation", "equivalence relations", false],
["logistic system", "logistic systems", true],
["tournament", "tournaments", false],
["random variable", "random variables", false],
["complexity class", "complexity classes", true],
["triangulation", "triangulations", false],
["unbounded-fan-in circuit", "unbounded-fan-in circuits", false],
["log-space reduction", "log-space reductions", false],
["language", "languages", true],
["poset", "posets", true],
["algebra", "algebras", true],
["Markov chain", "Markov chains", false],
["4-form", "4-forms", false],
["7-chain", "7-chains", false],
];
function randomFirst()
{
var ind = Math.floor(Math.random() * first.length);
return first[ind];
}
function randomSecond(plural)
{
var ind = Math.floor(Math.random() * second.length);
if (plural)
return second[ind][1];
else
{
while (!second[ind][2])
ind = Math.floor(Math.random() * second.length);
return second[ind][0];
}
}
function generate_name()
{
return randomFirst() + ' ' + randomSecond(false);
}
exports.generate_name = generate_name;