forked from rtkd/idkfa
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.js
219 lines (176 loc) · 5.54 KB
/
config.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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
/**
* Will hold config
*
* @type {object}
*/
const Config = {};
/**
* Command line arguments options
*/
Config.cla =
[
{ name: 'charAt', alias: 'c', type: Number, multiple: true, defaultValue: [] },
{ name: 'find', alias: 'f', type: String, multiple: true, defaultValue: [] },
{ name: 'invert', alias: 'i', type: String, multiple: true, defaultValue: [] },
{ name: 'key', alias: 'k', type: String, multiple: true, defaultValue: ['0'] },
{ name: 'patch', alias: 'p', type: String, multiple: true, defaultValue: [] },
{ name: 'source', alias: 's', type: String, multiple: true, defaultValue: [] },
{ name: 'to', alias: 't', type: String, multiple: true, defaultValue: [] }, // (!) Build me
{ name: 'verbose', alias: 'v', type: String, multiple: true, defaultValue: [] },
{ name: 'wordAt', alias: 'w', type: Number, multiple: true, defaultValue: [] }
];
/**
* Dictionary options
*/
Config.dict =
{
// Path to source file.
'src' : './data/dict',
// Source file encoding
'encoding' : 'utf8',
// Return x longest words
'longest' : 3,
// Return x most frequent words
'most' : 5,
// Normalize dictionary to Gematria
'isNormalized' : true
};
/**
* Encoding
*/
Config.encoding =
{
// Is value a mathematical expression?
'isExpression' : /^\$\((.*?)\)$/i, // /^(\$\().+(\))+$/i
// Is value within Futhark unicode range?
'isFuthark' : /^[\u16A0-\u16FF]+$/i,
// Is value an integer without leading zeros?
'isInteger' : /^(0|[1-9]\d*)$/,
// Is value comma separated values without leading zeros?
'isIntegerCSV' : /^(?!(?:\d+[, ])*0\d)(?:\d+(?:,\d+)*)+$/,
// Is value dot separated values without leading zeros? Repeat 0-5.
'isIntegerDSV' : /^(?!(?:\d+[. ])*0\d)(?:\d+(?:\.\d+){0,5}(?: |$))+$/,
// Is value latin?
'isLatin' : /^[a-z]+$/i
};
/**
* Input options
*/
Config.input =
{
// Accept: multiple integer.
'charAt' : { 'regex': Config.encoding.isInteger },
// Accept: multiple latin words.
'find' : { 'regex': Config.encoding.isLatin },
// Accept: multiple single latin chars.
'invert' : { 'regex': /^[fklopst]$/i },
// Accept: multiple integer, integerCSV, latin chars/words, futhark chars/words and mathematical expressions.
'key' : { 'regex': new RegExp(Config.encoding.isInteger.source + '|' + Config.encoding.isIntegerCSV.source + '|' + Config.encoding.isLatin.source + '|' + Config.encoding.isFuthark.source + '|' + Config.encoding.isExpression.source, 'i') },
// Accept: multiple single latin chars.
'patch' : { 'regex': /^[sd]$/i },
// Accept: multiple integerDSV.
'source' : { 'regex': Config.encoding.isIntegerDSV },
// (!) Build me
'to' : { 'regex': Config.encoding.isLatin },
// Accept: multiple single latin chars.
'verbose' : { 'regex': /^[cdfiklpswx]$/i },
// Accept: multiple integer.
'wordAt' : { 'regex': Config.encoding.isInteger },
};
/**
* IRC options
*/
Config.irc =
{
'isEnabled' : false,
'owner' : {},
'botalias' : '',
'server' : 'chat.freenode.net',
'nick' : '',
'options' :
{
'userName' : '',
'realName' : '',
'password' : '',
'port' : 6697,
'localAddress' : null,
'debug' : false,
'showErrors' : false,
'autoRejoin' : true,
'autoConnect' : true,
'channels' : [],
'secure' : true,
'selfSigned' : false,
'certExpired' : false,
'floodProtection' : true,
'floodProtectionDelay' : 900,
'sasl' : true,
'stripColors' : true,
'channelPrefixes' : '&#',
'messageSplit' : 512,
'encoding' : 'utf-8'
}
};
/**
* MathJS options
*/
Config.math =
{
// Limit amount of generateable primes
'maxPrimes': 20000,
// Limit amount of generateable integers
'maxIntegers': 100000,
// Limit amount of generateable fibonacci numbers
'maxFibonacci': 1000
};
/**
* Pastebin options
*/
Config.pastebin =
{
'user':
{
'api_dev_key' : '',
'api_user_name' : '',
'api_user_password' : ''
},
'paste':
{
'api_paste_format' :'js',
// 0 = Public, anonymous, 1 = Unlisted, anonymous, 2 = Private, user, 3 = Public, user
'privacy' : 1,
'duration' :'1M'
}
};
/**
* Source options
*/
Config.source =
{
// Path to source file.
'src' : './data/liber',
// Source file encoding
'encoding' : 'utf8',
// Hirachical delimiters within source file. § = Chapter, $ = Section, & = Paragraph, . = Clause, - = Word, '' = Char.
'delimiter' : ['§', '$', '&', '.', '-', ''],
'isPatched' : true,
// Hirachical offsets of single chars to replace.
'patch':
{
'0.1.0.1.9.1' : 'F',
'0.1.0.2.7.0' : 'F',
'0.1.0.2.10.0' : 'F',
'0.1.0.3.5.0' : 'F',
'0.1.0.3.12.2' : 'F',
'0.1.0.3.12.3' : 'F',
'0.1.0.4.7.3' : 'F',
'0.1.1.1.5.7' : 'F',
'0.1.1.2.5.7' : 'F',
'0.1.1.4.0.0' : 'F',
'0.1.1.5.5.3' : 'F',
'0.5.0.2.5.1' : 'F',
'0.5.0.2.7.6' : 'F',
'0.16.0.2.4.1' : 'F'
}
};
module.exports = Config;