-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathGenerator.R
451 lines (446 loc) · 23.9 KB
/
Generator.R
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
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
#!/usr/bin/env Rscript
# Dependencies
library('data.table')
library('english')
library('stringr')
library('stringi')
library('Hmisc')
library('NCmisc')
rm(list=ls())
numbers_only <- function(x) !grepl("\\D", x)
num_to_stri <- function(numl) {
numlist <- c()
numchar <- unlist(strsplit(numl, NULL))
for(numi in 1:length(numchar)) {
if(numchar[numi] == "0") {
numchar[numi] = "zero"
}
else if(numchar[numi] == "1") {
numchar[numi] = "one"
}
else if(numchar[numi] == "2") {
numchar[numi] = "two"
}
else if(numchar[numi] == "3") {
numchar[numi] = "three"
}
else if(numchar[numi] == "4") {
numchar[numi] = "four"
}
else if(numchar[numi] == "5") {
numchar[numi] = "five"
}
else if(numchar[numi] == "6") {
numchar[numi] = "six"
}
else if(numchar[numi] == "7") {
numchar[numi] = "seven"
}
else if(numchar[numi] == "8") {
numchar[numi] = "eight"
}
else if(numchar[numi] == "9") {
numchar[numi] = "nine"
}
}
numlist <- c(numlist, paste(numchar, sep="", collapse=""))
numlist <- c(numlist, toupper(paste(numchar, sep="", collapse="")))
numchar <- unlist(strsplit(numl, NULL))
for(numi in 1:length(numchar)) {
if(numchar[numi] == "0") {
numchar[numi] = "Zero"
}
else if(numchar[numi] == "1") {
numchar[numi] = "One"
}
else if(numchar[numi] == "2") {
numchar[numi] = "Two"
}
else if(numchar[numi] == "3") {
numchar[numi] = "Three"
}
else if(numchar[numi] == "4") {
numchar[numi] = "Four"
}
else if(numchar[numi] == "5") {
numchar[numi] = "Five"
}
else if(numchar[numi] == "6") {
numchar[numi] = "Six"
}
else if(numchar[numi] == "7") {
numchar[numi] = "Seven"
}
else if(numchar[numi] == "8") {
numchar[numi] = "Eight"
}
else if(numchar[numi] == "9") {
numchar[numi] = "Nine"
}
}
numlist <- c(numlist, paste(numchar, sep="", collapse=""))
if (numbers_only(numl)) {
numl <- as.integer(numl)
to_cap_str <- strsplit(str_replace(toString(as.english(numl)), "[-]", ' '), ' ', fixed=TRUE)
tcrfinal <- c()
for(tcr in to_cap_str) {
tcrfinal <- c(tcrfinal, capitalize(tcr))
}
numlist <- c(numlist, toString(paste(tcrfinal, sep="", collapse="")))
numlist <- c(numlist, toupper(toString(paste(tcrfinal, sep="", collapse=""))))
numlist <- c(numlist, tolower(toString(paste(tcrfinal, sep="", collapse=""))))
}
return(numlist)
} #Convert a number to equavalent word forms
rawb <- read.csv("./bibletaxonomy.csv", stringsAsFactors = FALSE, header = FALSE, col.names = c('book','chapter','verse')) #Read main list
#rawq <- read.csv("./qurantaxonomy.csv", stringsAsFactors = FALSE, header = FALSE, col.names = c('surah','verse'))
books <- unique(rawb$book)
master <- c()
years <- 1800:2200
years2 <- 0:99
sepchars_y <- c('@', '!', '$', '-', '.', ':', '_')
sepchars <- c('_', '.', '-', '!', '@', ':')
favs <- c('Genesis', 'Exodus', 'Job', 'Psalm', 'Proverbs', 'Matthew', 'Mark', 'Luke', 'John', 'Romans', '1 Corinthians', 'Acts', 'Revelation')
list3 <- c()
listS <- c()
list2 <- c('jesus', 'Jesus', 'jesus!', 'Jesus!', 'JESUS', 'JESUS!')
looptimes <- c()
if (file.exists(paste('./Lists/NumbersOnly.txt', sep="")))
#Delete file if it exists
file.remove(paste('./Lists/NumbersOnly.txt', sep=""))
if (file.exists(paste('./Lists/SpecialMaster.txt', sep="")))
#Delete file if it exists
file.remove(paste('./Lists/SpecialMaster.txt', sep=""))
if (file.exists(paste('./Lists/Years.txt', sep="")))
#Delete file if it exists
file.remove(paste('./Lists/Years.txt', sep=""))
for (i in 1:length(books)){
b <- books[i]
setb <- rawb[rawb$book == b,]
b <- gsub(' ', '', b)
list <- c(b, tolower(b), paste(b, '!', sep=''), paste(tolower(b), '!', sep=''))
numlist <- c()
fn <- paste('./Lists/', b, ".txt", sep="")
if (file.exists(fn))
#Delete file if it exists
file.remove(fn)
for (y in years) {
list3 <- c(list3, paste(b, toString(y), sep=''))
list3 <- c(list3, paste(b, toString(y), '!', sep=''))
list3 <- c(list3, paste(tolower(b), toString(y), sep=''))
list3 <- c(list3, paste(tolower(b), toString(y), '!', sep=''))
list3 <- c(list3, paste(toupper(b), toString(y), sep=''))
list3 <- c(list3, paste(toupper(b), toString(y), '!', sep=''))
for (sc in sepchars_y) {
list3 <- c(list3, paste(b, sc, toString(y), sep=''))
list3 <- c(list3, paste(b, sc, toString(y), '!', sep=''))
list3 <- c(list3, paste(tolower(b), sc, toString(y), sep=''))
list3 <- c(list3, paste(tolower(b), sc, toString(y), '!', sep=''))
list3 <- c(list3, paste(toupper(b), sc, toString(y), sep=''))
list3 <- c(list3, paste(toupper(b), sc, toString(y), '!', sep=''))
}
}
write.table(data.table(list3), paste('./Lists/Years.txt', sep=""), col.names = FALSE, row.names = FALSE, quote = FALSE, append = TRUE)
list3 <- c()
for (y in years2) {
if (y < 10) {
list3 <- c(list3, paste(b, paste0('0', toString(y)), sep=''))
list3 <- c(list3, paste(b, paste0('0', toString(y)), '!', sep=''))
list3 <- c(list3, paste(tolower(b), paste0('0', toString(y)), sep=''))
list3 <- c(list3, paste(tolower(b), paste0('0', toString(y)), '!', sep=''))
list3 <- c(list3, paste(toupper(b), paste0('0', toString(y)), sep=''))
list3 <- c(list3, paste(toupper(b), paste0('0', toString(y)), '!', sep=''))
for (sc in sepchars_y) {
list3 <- c(list3, paste(b, sc, toString(y), sep=''))
list3 <- c(list3, paste(b, sc, toString(y), '!', sep=''))
list3 <- c(list3, paste(tolower(b), sc, paste0('0', toString(y)), sep=''))
list3 <- c(list3, paste(tolower(b), sc, paste0('0', toString(y)), '!', sep=''))
list3 <- c(list3, paste(toupper(b), sc, paste0('0', toString(y)), sep=''))
list3 <- c(list3, paste(toupper(b), sc, paste0('0', toString(y)), '!', sep=''))
}
}
else {
list3 <- c(list3, paste(b, toString(y), sep=''))
list3 <- c(list3, paste(b, toString(y), '!', sep=''))
list3 <- c(list3, paste(tolower(b), toString(y), sep=''))
list3 <- c(list3, paste(tolower(b), toString(y), '!', sep=''))
list3 <- c(list3, paste(toupper(b), toString(y), sep=''))
list3 <- c(list3, paste(toupper(b), toString(y), '!', sep=''))
for (sc in sepchars_y) {
list3 <- c(list3, paste(b, sc, toString(y), sep=''))
list3 <- c(list3, paste(b, sc, toString(y), '!', sep=''))
list3 <- c(list3, paste(tolower(b), sc, toString(y), sep=''))
list3 <- c(list3, paste(tolower(b), sc, toString(y), '!', sep=''))
list3 <- c(list3, paste(toupper(b), sc, toString(y), sep=''))
list3 <- c(list3, paste(toupper(b), sc, toString(y), '!', sep=''))
}
}
}
write.table(data.table(list3), paste('./Lists/Years.txt', sep=""), col.names = FALSE, row.names = FALSE, quote = FALSE, append = TRUE)
list3 <- c()
if (b == 'Revelation' || b == 'Psalm') {
b4 <- paste(b, 's', sep="")
for (y in years) {
list3 <- c(list3, paste(b4, toString(y), sep=''))
list3 <- c(list3, paste(b4, toString(y), '!', sep=''))
list3 <- c(list3, paste(tolower(b4), toString(y), sep=''))
list3 <- c(list3, paste(tolower(b4), toString(y), '!', sep=''))
list3 <- c(list3, paste(toupper(b4), toString(y), sep=''))
list3 <- c(list3, paste(toupper(b4), toString(y), '!', sep=''))
for (sc in sepchars_y) {
list3 <- c(list3, paste(b4, sc, toString(y), sep=''))
list3 <- c(list3, paste(b4, sc, toString(y), '!', sep=''))
list3 <- c(list3, paste(tolower(b4), sc, toString(y), sep=''))
list3 <- c(list3, paste(tolower(b4), sc, toString(y), '!', sep=''))
list3 <- c(list3, paste(toupper(b4), sc, toString(y), sep=''))
list3 <- c(list3, paste(toupper(b4), sc, toString(y), '!', sep=''))
}
}
for (y in years2) {
if (y < 10) {
list3 <- c(list3, paste(b4, paste0('0', toString(y)), sep=''))
list3 <- c(list3, paste(b4, paste0('0', toString(y)), '!', sep=''))
list3 <- c(list3, paste(tolower(b4), paste0('0', toString(y)), sep=''))
list3 <- c(list3, paste(tolower(b4), paste0('0', toString(y)), '!', sep=''))
list3 <- c(list3, paste(toupper(b4), paste0('0', toString(y)), sep=''))
list3 <- c(list3, paste(toupper(b4), paste0('0', toString(y)), '!', sep=''))
for (sc in sepchars_y) {
list3 <- c(list3, paste(b4, sc, toString(y), sep=''))
list3 <- c(list3, paste(b4, sc, toString(y), '!', sep=''))
list3 <- c(list3, paste(tolower(b4), sc, paste0('0', toString(y)), sep=''))
list3 <- c(list3, paste(tolower(b4), sc, paste0('0', toString(y)), '!', sep=''))
list3 <- c(list3, paste(toupper(b4), sc, paste0('0', toString(y)), sep=''))
list3 <- c(list3, paste(toupper(b4), sc, paste0('0', toString(y)), '!', sep=''))
}
}
else {
list3 <- c(list3, paste(b4, toString(y), sep=''))
list3 <- c(list3, paste(b4, toString(y), '!', sep=''))
list3 <- c(list3, paste(tolower(b4), toString(y), sep=''))
list3 <- c(list3, paste(tolower(b4), toString(y), '!', sep=''))
list3 <- c(list3, paste(toupper(b4), toString(y), sep=''))
list3 <- c(list3, paste(toupper(b4), toString(y), '!', sep=''))
for (sc in sepchars_y) {
list3 <- c(list3, paste(b4, sc, toString(y), sep=''))
list3 <- c(list3, paste(b4, sc, toString(y), '!', sep=''))
list3 <- c(list3, paste(tolower(b4), sc, toString(y), sep=''))
list3 <- c(list3, paste(tolower(b4), sc, toString(y), '!', sep=''))
list3 <- c(list3, paste(toupper(b4), sc, toString(y), sep=''))
list3 <- c(list3, paste(toupper(b4), sc, toString(y), '!', sep=''))
}
}
}
}
for (c in unique(setb$chapter)){
list <- c(list, paste(b, toString(c), sep=''))
list <- c(list, paste(b, toString(c), '!', sep=''))
list <- c(list, paste(tolower(b), toString(c), sep=''))
list <- c(list, paste(tolower(b), toString(c), '!', sep=''))
list <- c(list, paste(toupper(b), toString(c), sep=''))
list <- c(list, paste(toupper(b), toString(c), '!', sep=''))
c2list <- num_to_stri(toString(c))
for (c2 in c2list) {
list <- c(list, paste(b, toString(c2), sep=''))
list <- c(list, paste(b, toString(c2), '!', sep=''))
list <- c(list, paste(tolower(b), toString(c2), sep=''))
list <- c(list, paste(tolower(b), toString(c2), '!', sep=''))
list <- c(list, paste(toupper(b), toString(c2), sep=''))
list <- c(list, paste(toupper(b), toString(c2), '!', sep=''))
}
for (sc in sepchars) {
listS <- c(listS, paste(b, sc, toString(c), sep=''))
listS <- c(listS, paste(b, sc, toString(c), '!', sep=''))
listS <- c(listS, paste(tolower(b), sc, toString(c), sep=''))
listS <- c(listS, paste(tolower(b), sc, toString(c), '!', sep=''))
listS <- c(listS, paste(toupper(b), sc, toString(c), sep=''))
listS <- c(listS, paste(toupper(b), sc, toString(c), '!', sep=''))
}
ptm <- proc.time()
for (v in setb[setb$chapter == c, 'verse']) {
numlist <- c(numlist, paste(toString(c), toString(v), sep=''))
numlist <- c(numlist, paste(toString(c), ':', toString(v), sep=''))
numlist <- c(numlist, paste(toString(c), toString(v), '!', sep=''))
numlist <- c(numlist, paste(toString(c), ':', toString(v), '!', sep=''))
list <- c(list, paste(b, toString(c), toString(v), sep=''))
list <- c(list, paste(b, toString(c), ':', toString(v), sep=''))
list <- c(list, paste(b, toString(c), toString(v), '!', sep=''))
list <- c(list, paste(b, toString(c), ':', toString(v), '!', sep=''))
list <- c(list, paste(tolower(b), toString(c), toString(v), sep=''))
list <- c(list, paste(tolower(b), toString(c), ':', toString(v), sep=''))
list <- c(list, paste(tolower(b), toString(c), toString(v), '!', sep=''))
list <- c(list, paste(tolower(b), toString(c), ':', toString(v), '!', sep=''))
list <- c(list, paste(toupper(b), toString(c), toString(v), sep=''))
list <- c(list, paste(toupper(b), toString(c), ':', toString(v), sep=''))
list <- c(list, paste(toupper(b), toString(c), toString(v), '!', sep=''))
list <- c(list, paste(toupper(b), toString(c), ':', toString(v), '!', sep=''))
v2list <- num_to_stri(toString(v))
for (c2 in c2list) {
for (v2 in v2list) {
list <- c(list, paste(b, toString(c2), toString(v2), sep=''))
list <- c(list, paste(b, toString(c2), ':', toString(v2), sep=''))
list <- c(list, paste(b, toString(c2), toString(v2), '!', sep=''))
list <- c(list, paste(b, toString(c2), ':', toString(v2), '!', sep=''))
list <- c(list, paste(tolower(b), toString(c2), toString(v2), sep=''))
list <- c(list, paste(tolower(b), toString(c2), ':', toString(v2), sep=''))
list <- c(list, paste(tolower(b), toString(c2), toString(v2), '!', sep=''))
list <- c(list, paste(tolower(b), toString(c2), ':', toString(v2), '!', sep=''))
list <- c(list, paste(toupper(b), toString(c2), toString(v2), sep=''))
list <- c(list, paste(toupper(b), toString(c2), ':', toString(v2), sep=''))
list <- c(list, paste(toupper(b), toString(c2), toString(v2), '!', sep=''))
list <- c(list, paste(toupper(b), toString(c2), ':', toString(v2), '!', sep=''))
}
}
if (b %in% favs) {
for (sc in sepchars) {
listS <- c(listS, paste(b, sc, toString(c), toString(v), sep=''))
listS <- c(listS, paste(b, sc, toString(c), ':', toString(v), sep=''))
listS <- c(listS, paste(b, sc, toString(c), toString(v), '!', sep=''))
listS <- c(listS, paste(b, sc, toString(c), ':', toString(v), '!', sep=''))
listS <- c(listS, paste(tolower(b), sc, toString(c), toString(v), sep=''))
listS <- c(listS, paste(tolower(b), sc, toString(c), ':', toString(v), sep=''))
listS <- c(listS, paste(tolower(b), sc, toString(c), toString(v), '!', sep=''))
listS <- c(listS, paste(tolower(b), sc, toString(c), ':', toString(v), '!', sep=''))
listS <- c(listS, paste(toupper(b), sc, toString(c), toString(v), sep=''))
listS <- c(listS, paste(toupper(b), sc, toString(c), ':', toString(v), sep=''))
listS <- c(listS, paste(toupper(b), sc, toString(c), toString(v), '!', sep=''))
listS <- c(listS, paste(toupper(b), sc, toString(c), ':', toString(v), '!', sep=''))
}
}
list2 <- c(list2, paste('jesus', toString(c), toString(v), sep=''))
list2 <- c(list2, paste('jesus', toString(c), ':', toString(v), sep=''))
list2 <- c(list2, paste('Jesus', toString(c), toString(v), sep=''))
list2 <- c(list2, paste('Jesus', toString(c), ':', toString(v), sep=''))
list2 <- c(list2, paste('JESUS', toString(c), toString(v), sep=''))
list2 <- c(list2, paste('JESUS', toString(c), ':', toString(v), sep=''))
list2 <- c(list2, paste('jesus', toString(c), toString(v), '!', sep=''))
list2 <- c(list2, paste('jesus', toString(c), ':', toString(v), '!', sep=''))
list2 <- c(list2, paste('Jesus', toString(c), toString(v), '!', sep=''))
list2 <- c(list2, paste('Jesus', toString(c), ':', toString(v), '!', sep=''))
list2 <- c(list2, paste('JESUS', toString(c), toString(v), '!', sep=''))
list2 <- c(list2, paste('JESUS', toString(c), ':', toString(v), '!', sep=''))
if (grepl('\\d', b)) {
b3 <- gsub('1', 'I', b)
b3 <- gsub('2', 'II', b3)
b3 <- gsub('3', 'III', b3)
list <- c(list, paste(b3, toString(c), toString(v), sep=''))
list <- c(list, paste(b3, toString(c), ':', toString(v), sep=''))
list <- c(list, paste(b3, toString(c), toString(v), '!', sep=''))
list <- c(list, paste(b3, toString(c), ':', toString(v), '!', sep=''))
list <- c(list, paste(tolower(b3), toString(c), toString(v), sep=''))
list <- c(list, paste(tolower(b3), toString(c), ':', toString(v), sep=''))
list <- c(list, paste(tolower(b3), toString(c), toString(v), '!', sep=''))
list <- c(list, paste(tolower(b3), toString(c), ':', toString(v), '!', sep=''))
list <- c(list, paste(toupper(b3), toString(c), toString(v), sep=''))
list <- c(list, paste(toupper(b3), toString(c), ':', toString(v), sep=''))
list <- c(list, paste(toupper(b3), toString(c), toString(v), '!', sep=''))
list <- c(list, paste(toupper(b3), toString(c), ':', toString(v), '!', sep=''))
for (c2 in c2list) {
for (v2 in v2list) {
list <- c(list, paste(b3, toString(c2), toString(v2), sep=''))
list <- c(list, paste(b3, toString(c2), ':', toString(v2), sep=''))
list <- c(list, paste(b3, toString(c2), toString(v2), '!', sep=''))
list <- c(list, paste(b3, toString(c2), ':', toString(v2), '!', sep=''))
list <- c(list, paste(tolower(b3), toString(c2), toString(v2), sep=''))
list <- c(list, paste(tolower(b3), toString(c2), ':', toString(v2), sep=''))
list <- c(list, paste(tolower(b3), toString(c2), toString(v2), '!', sep=''))
list <- c(list, paste(tolower(b3), toString(c2), ':', toString(v2), '!', sep=''))
list <- c(list, paste(toupper(b3), toString(c2), toString(v2), sep=''))
list <- c(list, paste(toupper(b3), toString(c2), ':', toString(v2), sep=''))
list <- c(list, paste(toupper(b3), toString(c2), toString(v2), '!', sep=''))
list <- c(list, paste(toupper(b3), toString(c2), ':', toString(v2), '!', sep=''))
}
}
if (b %in% favs) {
for (sc in sepchars) {
listS <- c(listS, paste(b3, sc, toString(c), toString(v), sep=''))
listS <- c(listS, paste(b3, sc, toString(c), ':', toString(v), sep=''))
listS <- c(listS, paste(b3, sc, toString(c), toString(v), '!', sep=''))
listS <- c(listS, paste(b3, sc, toString(c), ':', toString(v), '!', sep=''))
listS <- c(listS, paste(tolower(b3), sc, toString(c), toString(v), sep=''))
listS <- c(listS, paste(tolower(b3), sc, toString(c), ':', toString(v), sep=''))
listS <- c(listS, paste(tolower(b3), sc, toString(c), toString(v), '!', sep=''))
listS <- c(listS, paste(tolower(b3), sc, toString(c), ':', toString(v), '!', sep=''))
listS <- c(listS, paste(toupper(b3), sc, toString(c), toString(v), sep=''))
listS <- c(listS, paste(toupper(b3), sc, toString(c), ':', toString(v), sep=''))
listS <- c(listS, paste(toupper(b3), sc, toString(c), toString(v), '!', sep=''))
listS <- c(listS, paste(toupper(b3), sc, toString(c), ':', toString(v), '!', sep=''))
}
}
}
if (b == 'Revelation' || b == 'Psalm') {
b2 <- paste(b, 's', sep="")
list <- c(list, b2, tolower(b2), paste(b2, '!', sep=''), paste(tolower(b2), '!', sep=''))
list <- c(list, paste(b2, toString(c), toString(v), sep=''))
list <- c(list, paste(b2, toString(c), ':', toString(v), sep=''))
list <- c(list, paste(b2, toString(c), toString(v), '!', sep=''))
list <- c(list, paste(b2, toString(c), ':', toString(v), '!', sep=''))
list <- c(list, paste(tolower(b2), toString(c), toString(v), sep=''))
list <- c(list, paste(tolower(b2), toString(c), ':', toString(v), sep=''))
list <- c(list, paste(tolower(b2), toString(c), toString(v), '!', sep=''))
list <- c(list, paste(tolower(b2), toString(c), ':', toString(v), '!', sep=''))
list <- c(list, paste(toupper(b2), toString(c), toString(v), sep=''))
list <- c(list, paste(toupper(b2), toString(c), ':', toString(v), sep=''))
list <- c(list, paste(toupper(b2), toString(c), toString(v), '!', sep=''))
list <- c(list, paste(toupper(b2), toString(c), ':', toString(v), '!', sep=''))
for (c2 in c2list) {
for (v2 in v2list) {
list <- c(list, paste(b2, toString(c2), toString(v2), sep=''))
list <- c(list, paste(b2, toString(c2), ':', toString(v2), sep=''))
list <- c(list, paste(b2, toString(c2), toString(v2), '!', sep=''))
list <- c(list, paste(b2, toString(c2), ':', toString(v2), '!', sep=''))
list <- c(list, paste(tolower(b2), toString(c2), toString(v2), sep=''))
list <- c(list, paste(tolower(b2), toString(c2), ':', toString(v2), sep=''))
list <- c(list, paste(tolower(b2), toString(c2), toString(v2), '!', sep=''))
list <- c(list, paste(tolower(b2), toString(c2), ':', toString(v2), '!', sep=''))
list <- c(list, paste(toupper(b2), toString(c2), toString(v2), sep=''))
list <- c(list, paste(toupper(b2), toString(c2), ':', toString(v2), sep=''))
list <- c(list, paste(toupper(b2), toString(c2), toString(v2), '!', sep=''))
list <- c(list, paste(toupper(b2), toString(c2), ':', toString(v2), '!', sep=''))
}
}
for (sc in sepchars) {
listS <- c(listS, paste(b2, sc, toString(c), toString(v), sep=''))
listS <- c(listS, paste(b2, sc, toString(c), ':', toString(v), sep=''))
listS <- c(listS, paste(b2, sc, toString(c), toString(v), '!', sep=''))
listS <- c(listS, paste(b2, sc, toString(c), ':', toString(v), '!', sep=''))
listS <- c(listS, paste(tolower(b2), sc, toString(c), toString(v), sep=''))
listS <- c(listS, paste(tolower(b2), sc, toString(c), ':', toString(v), sep=''))
listS <- c(listS, paste(tolower(b2), sc, toString(c), toString(v), '!', sep=''))
listS <- c(listS, paste(tolower(b2), sc, toString(c), ':', toString(v), '!', sep=''))
listS <- c(listS, paste(toupper(b2), sc, toString(c), toString(v), sep=''))
listS <- c(listS, paste(toupper(b2), sc, toString(c), ':', toString(v), sep=''))
listS <- c(listS, paste(toupper(b2), sc, toString(c), toString(v), '!', sep=''))
listS <- c(listS, paste(toupper(b2), sc, toString(c), ':', toString(v), '!', sep=''))
}
}
looptimes <- c(looptimes, as.double(proc.time() - ptm)[3])
print(paste0(b,toString(c),':',toString(v), ", Average per verse is ", round(mean(looptimes), digits = 3), "secs."))
list <- unique(list)
write.table(data.table(numlist), paste('./Lists/NumbersOnly.txt', sep=""), col.names = FALSE, row.names = FALSE, quote = FALSE, append = TRUE)
write.table(data.table(list), fn, col.names = FALSE, row.names = FALSE, quote = FALSE, append = TRUE)
write.table(data.table(listS), paste('./Lists/SpecialMaster.txt', sep=""), col.names = FALSE, row.names = FALSE, quote = FALSE, append = TRUE)
list <- c()
listS <- c()
numlist <- c()
}
}
}
master <- c()
for (i in 1:length(books)) {
b <- books[i]
setb <- rawb[rawb$book == b,]
b <- gsub(' ', '', b)
fn <- paste('./Lists/', b, ".txt", sep="")
master <- c(master, read.table(fn, header = FALSE, stringsAsFactors = FALSE))
print(paste0('Read ',b))
}
write.table(data.table(unique(unlist(read.table(paste('./Lists/NumbersOnly.txt', sep=""), header = FALSE, stringsAsFactors = FALSE), use.names = FALSE))), paste('./Lists/NumbersOnly.txt', sep=""), col.names = FALSE, row.names = FALSE, quote = FALSE)
master <- unlist(master, use.names = FALSE)
list2 <- sort(unique(list2))
write.table(data.table(list2), paste('./Lists/Jesus.txt', sep=""), col.names = FALSE, row.names = FALSE, quote = FALSE)
master <- c(master, unlist(read.table(paste('./Lists/SpecialMaster.txt', sep=""), header = FALSE, stringsAsFactors = FALSE), use.names = FALSE), unlist(read.table(paste('./Lists/Years.txt', sep=""), header = FALSE, stringsAsFactors = FALSE), use.names = FALSE), unlist(read.table(paste('./Lists/NumbersOnly.txt', sep=""), header = FALSE, stringsAsFactors = FALSE), use.names = FALSE), list2)
master <- unique(master)
final.file <- file(paste('./BiblePass.txt', sep=""), "wb")
write.table(data.table(master), final.file, col.names = FALSE, row.names = FALSE, quote = FALSE)
close(final.file)
file.split(paste('./BiblePass.txt', sep=""), size=900000, same.dir=TRUE, verbose=FALSE)