code_zauker 0.0.7 → 0.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/bin/czindexer +12 -1
- data/bin/czsearch +31 -8
- data/bin/mczindexer +1 -1
- data/devel.org +10 -0
- data/doc/CodeZauker/CliUtil.html +451 -0
- data/doc/CodeZauker/FileScanner.html +357 -190
- data/doc/CodeZauker/IndexManager.html +331 -0
- data/doc/CodeZauker/Util.html +65 -46
- data/doc/CodeZauker.html +58 -25
- data/doc/Grep.html +29 -19
- data/doc/_index.html +49 -23
- data/doc/class_list.html +12 -6
- data/doc/css/full_list.css +4 -2
- data/doc/css/style.css +50 -44
- data/doc/file_list.html +12 -6
- data/doc/frames.html +20 -5
- data/doc/index.html +49 -23
- data/doc/js/app.js +29 -26
- data/doc/js/full_list.js +9 -9
- data/doc/js/jquery.js +4 -16
- data/doc/method_list.html +66 -12
- data/doc/top-level-namespace.html +40 -18
- data/etc/redis.conf +3 -3
- data/lib/code_zauker/cli.rb +16 -1
- data/lib/code_zauker/constants.rb +7 -1
- data/lib/code_zauker/version.rb +2 -1
- data/lib/code_zauker.rb +85 -3
- data/readme.org +19 -22
- data/test/fixture/wildtest.txt +1 -0
- data/test/test_wild_search.rb +39 -0
- metadata +20 -16
@@ -6,7 +6,7 @@
|
|
6
6
|
<title>
|
7
7
|
Class: CodeZauker::FileScanner
|
8
8
|
|
9
|
-
— Code Zauker 0.0.
|
9
|
+
— Code Zauker 0.0.8 Documentation
|
10
10
|
|
11
11
|
</title>
|
12
12
|
|
@@ -15,10 +15,12 @@
|
|
15
15
|
<link rel="stylesheet" href="../css/common.css" type="text/css" media="screen" charset="utf-8" />
|
16
16
|
|
17
17
|
<script type="text/javascript" charset="utf-8">
|
18
|
-
|
19
|
-
|
18
|
+
hasFrames = window.top.frames.main ? true : false;
|
19
|
+
relpath = '../';
|
20
|
+
framesUrl = "../frames.html#!" + escape(window.location.href);
|
20
21
|
</script>
|
21
22
|
|
23
|
+
|
22
24
|
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
|
23
25
|
|
24
26
|
<script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
|
@@ -26,36 +28,41 @@
|
|
26
28
|
|
27
29
|
</head>
|
28
30
|
<body>
|
29
|
-
<script type="text/javascript" charset="utf-8">
|
30
|
-
if (window.top.frames.main) document.body.className = 'frames';
|
31
|
-
</script>
|
32
|
-
|
33
31
|
<div id="header">
|
34
32
|
<div id="menu">
|
35
33
|
|
36
|
-
<a href="../_index.html">Index (F)</a> »
|
34
|
+
<a href="../_index.html">Index (F)</a> »
|
37
35
|
<span class='title'><span class='object_link'><a href="../CodeZauker.html" title="CodeZauker (module)">CodeZauker</a></span></span>
|
38
36
|
»
|
39
37
|
<span class="title">FileScanner</span>
|
40
38
|
|
41
|
-
|
39
|
+
|
42
40
|
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
43
41
|
</div>
|
44
42
|
|
45
43
|
<div id="search">
|
46
44
|
|
47
|
-
<a
|
45
|
+
<a class="full_list_link" id="class_list_link"
|
46
|
+
href="../class_list.html">
|
47
|
+
Class List
|
48
|
+
</a>
|
48
49
|
|
49
|
-
<a
|
50
|
+
<a class="full_list_link" id="method_list_link"
|
51
|
+
href="../method_list.html">
|
52
|
+
Method List
|
53
|
+
</a>
|
50
54
|
|
51
|
-
<a
|
55
|
+
<a class="full_list_link" id="file_list_link"
|
56
|
+
href="../file_list.html">
|
57
|
+
File List
|
58
|
+
</a>
|
52
59
|
|
53
60
|
</div>
|
54
61
|
<div class="clear"></div>
|
55
62
|
</div>
|
56
|
-
|
63
|
+
|
57
64
|
<iframe id="search_frame"></iframe>
|
58
|
-
|
65
|
+
|
59
66
|
<div id="content"><h1>Class: CodeZauker::FileScanner
|
60
67
|
|
61
68
|
|
@@ -133,6 +140,7 @@ find file scontaining the trigram...</p>
|
|
133
140
|
|
134
141
|
|
135
142
|
|
143
|
+
|
136
144
|
|
137
145
|
|
138
146
|
<span class="summary_desc"><div class='inline'></div></span>
|
@@ -149,6 +157,7 @@ find file scontaining the trigram...</p>
|
|
149
157
|
|
150
158
|
</span>
|
151
159
|
|
160
|
+
|
152
161
|
<span class="note title constructor">constructor</span>
|
153
162
|
|
154
163
|
|
@@ -179,6 +188,7 @@ find file scontaining the trigram...</p>
|
|
179
188
|
|
180
189
|
|
181
190
|
|
191
|
+
|
182
192
|
|
183
193
|
|
184
194
|
<span class="summary_desc"><div class='inline'>
|
@@ -204,6 +214,7 @@ find file scontaining the trigram...</p>
|
|
204
214
|
|
205
215
|
|
206
216
|
|
217
|
+
|
207
218
|
|
208
219
|
|
209
220
|
<span class="summary_desc"><div class='inline'></div></span>
|
@@ -225,6 +236,7 @@ find file scontaining the trigram...</p>
|
|
225
236
|
|
226
237
|
|
227
238
|
|
239
|
+
|
228
240
|
|
229
241
|
|
230
242
|
<span class="summary_desc"><div class='inline'></div></span>
|
@@ -246,6 +258,7 @@ find file scontaining the trigram...</p>
|
|
246
258
|
|
247
259
|
|
248
260
|
|
261
|
+
|
249
262
|
|
250
263
|
|
251
264
|
<span class="summary_desc"><div class='inline'></div></span>
|
@@ -267,6 +280,7 @@ find file scontaining the trigram...</p>
|
|
267
280
|
|
268
281
|
|
269
282
|
|
283
|
+
|
270
284
|
|
271
285
|
|
272
286
|
<span class="summary_desc"><div class='inline'>
|
@@ -290,6 +304,7 @@ find file scontaining the trigram...</p>
|
|
290
304
|
|
291
305
|
|
292
306
|
|
307
|
+
|
293
308
|
|
294
309
|
|
295
310
|
<span class="summary_desc"><div class='inline'>
|
@@ -313,6 +328,7 @@ find file scontaining the trigram...</p>
|
|
313
328
|
|
314
329
|
|
315
330
|
|
331
|
+
|
316
332
|
|
317
333
|
|
318
334
|
<span class="summary_desc"><div class='inline'>
|
@@ -322,6 +338,33 @@ find file scontaining the trigram...</p>
|
|
322
338
|
padded into trigrams.</p>
|
323
339
|
</div></span>
|
324
340
|
|
341
|
+
</li>
|
342
|
+
|
343
|
+
|
344
|
+
<li class="public ">
|
345
|
+
<span class="summary_signature">
|
346
|
+
|
347
|
+
<a href="#wsearch-instance_method" title="#wsearch (instance method)">- (Object) <strong>wsearch</strong>(term) </a>
|
348
|
+
|
349
|
+
|
350
|
+
|
351
|
+
</span>
|
352
|
+
|
353
|
+
|
354
|
+
|
355
|
+
|
356
|
+
|
357
|
+
|
358
|
+
|
359
|
+
|
360
|
+
|
361
|
+
<span class="summary_desc"><div class='inline'>
|
362
|
+
<h1>wild cards search</h1>
|
363
|
+
|
364
|
+
<p>You can search trigram in the form public*class*Apple will match java
|
365
|
+
declaration of MyApple but not YourAppManager.</p>
|
366
|
+
</div></span>
|
367
|
+
|
325
368
|
</li>
|
326
369
|
|
327
370
|
|
@@ -332,13 +375,15 @@ padded into trigrams.</p>
|
|
332
375
|
<h2>Constructor Details</h2>
|
333
376
|
|
334
377
|
<div class="method_details first">
|
335
|
-
<
|
378
|
+
<h3 class="signature first" id="initialize-instance_method">
|
336
379
|
|
337
380
|
- (<tt><span class='object_link'><a href="" title="CodeZauker::FileScanner (class)">FileScanner</a></span></tt>) <strong>initialize</strong>(redisConnection = nil)
|
338
381
|
|
339
382
|
|
340
383
|
|
341
|
-
|
384
|
+
|
385
|
+
|
386
|
+
</h3><div class="docstring">
|
342
387
|
<div class="discussion">
|
343
388
|
|
344
389
|
<p>A new instance of FileScanner</p>
|
@@ -355,16 +400,16 @@ padded into trigrams.</p>
|
|
355
400
|
<pre class="lines">
|
356
401
|
|
357
402
|
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
403
|
+
154
|
404
|
+
155
|
405
|
+
156
|
406
|
+
157
|
407
|
+
158
|
408
|
+
159
|
409
|
+
160</pre>
|
365
410
|
</td>
|
366
411
|
<td>
|
367
|
-
<pre class="code"><span class="info file"># File 'lib/code_zauker.rb', line
|
412
|
+
<pre class="code"><span class="info file"># File 'lib/code_zauker.rb', line 154</span>
|
368
413
|
|
369
414
|
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_redisConnection'>redisConnection</span><span class='op'>=</span><span class='kw'>nil</span><span class='rparen'>)</span>
|
370
415
|
<span class='kw'>if</span> <span class='id identifier rubyid_redisConnection'>redisConnection</span><span class='op'>==</span><span class='kw'>nil</span>
|
@@ -383,30 +428,42 @@ padded into trigrams.</p>
|
|
383
428
|
|
384
429
|
<div id="instance_method_details" class="method_details_list">
|
385
430
|
<h2>Instance Method Details</h2>
|
386
|
-
|
431
|
+
|
387
432
|
|
388
433
|
<div class="method_details first">
|
389
|
-
<
|
434
|
+
<h3 class="signature first" id="disconnect-instance_method">
|
390
435
|
|
391
436
|
- (<tt>Object</tt>) <strong>disconnect</strong>
|
392
437
|
|
393
438
|
|
394
439
|
|
395
|
-
|
440
|
+
|
441
|
+
|
442
|
+
</h3><table class="source_code">
|
396
443
|
<tr>
|
397
444
|
<td>
|
398
445
|
<pre class="lines">
|
399
446
|
|
400
447
|
|
401
|
-
|
402
|
-
|
403
|
-
|
448
|
+
163
|
449
|
+
164
|
450
|
+
165
|
451
|
+
166
|
452
|
+
167
|
453
|
+
168
|
454
|
+
169
|
455
|
+
170</pre>
|
404
456
|
</td>
|
405
457
|
<td>
|
406
|
-
<pre class="code"><span class="info file"># File 'lib/code_zauker.rb', line
|
458
|
+
<pre class="code"><span class="info file"># File 'lib/code_zauker.rb', line 163</span>
|
407
459
|
|
408
460
|
<span class='kw'>def</span> <span class='id identifier rubyid_disconnect'>disconnect</span><span class='lparen'>(</span><span class='rparen'>)</span>
|
409
|
-
<span class='
|
461
|
+
<span class='kw'>begin</span>
|
462
|
+
<span class='ivar'>@redis</span><span class='period'>.</span><span class='id identifier rubyid_quit'>quit</span>
|
463
|
+
<span class='kw'>rescue</span> <span class='const'>Errno</span><span class='op'>::</span><span class='const'>EAGAIN</span> <span class='op'>=></span><span class='id identifier rubyid_e'>e</span>
|
464
|
+
<span class='comment'># Nothing to do...
|
465
|
+
</span> <span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Ignored EAGAIN ERROR during disconnect...</span><span class='tstring_end'>"</span></span>
|
466
|
+
<span class='kw'>end</span>
|
410
467
|
<span class='kw'>end</span></pre>
|
411
468
|
</td>
|
412
469
|
</tr>
|
@@ -414,13 +471,15 @@ padded into trigrams.</p>
|
|
414
471
|
</div>
|
415
472
|
|
416
473
|
<div class="method_details ">
|
417
|
-
<
|
474
|
+
<h3 class="signature " id="isearch-instance_method">
|
418
475
|
|
419
476
|
- (<tt>Object</tt>) <strong>isearch</strong>(term)
|
420
477
|
|
421
478
|
|
422
479
|
|
423
|
-
|
480
|
+
|
481
|
+
|
482
|
+
</h3><div class="docstring">
|
424
483
|
<div class="discussion">
|
425
484
|
|
426
485
|
<h1>Do a case-insenitive search </h1>
|
@@ -439,18 +498,18 @@ padded into trigrams.</p>
|
|
439
498
|
<pre class="lines">
|
440
499
|
|
441
500
|
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
501
|
+
329
|
502
|
+
330
|
503
|
+
331
|
504
|
+
332
|
505
|
+
333
|
506
|
+
334
|
507
|
+
335
|
508
|
+
336
|
509
|
+
337</pre>
|
451
510
|
</td>
|
452
511
|
<td>
|
453
|
-
<pre class="code"><span class="info file"># File 'lib/code_zauker.rb', line
|
512
|
+
<pre class="code"><span class="info file"># File 'lib/code_zauker.rb', line 329</span>
|
454
513
|
|
455
514
|
<span class='kw'>def</span> <span class='id identifier rubyid_isearch'>isearch</span><span class='lparen'>(</span><span class='id identifier rubyid_term'>term</span><span class='rparen'>)</span>
|
456
515
|
<span class='id identifier rubyid_termLowercase'>termLowercase</span><span class='op'>=</span><span class='id identifier rubyid_term'>term</span><span class='period'>.</span><span class='id identifier rubyid_downcase'>downcase</span><span class='lparen'>(</span><span class='rparen'>)</span>
|
@@ -467,65 +526,20 @@ padded into trigrams.</p>
|
|
467
526
|
</div>
|
468
527
|
|
469
528
|
<div class="method_details ">
|
470
|
-
<
|
529
|
+
<h3 class="signature " id="load-instance_method">
|
471
530
|
|
472
531
|
- (<tt>Object</tt>) <strong>load</strong>(filename, noReload = false)
|
473
532
|
|
474
533
|
|
475
534
|
|
476
|
-
|
535
|
+
|
536
|
+
|
537
|
+
</h3><table class="source_code">
|
477
538
|
<tr>
|
478
539
|
<td>
|
479
540
|
<pre class="lines">
|
480
541
|
|
481
542
|
|
482
|
-
184
|
483
|
-
185
|
484
|
-
186
|
485
|
-
187
|
486
|
-
188
|
487
|
-
189
|
488
|
-
190
|
489
|
-
191
|
490
|
-
192
|
491
|
-
193
|
492
|
-
194
|
493
|
-
195
|
494
|
-
196
|
495
|
-
197
|
496
|
-
198
|
497
|
-
199
|
498
|
-
200
|
499
|
-
201
|
500
|
-
202
|
501
|
-
203
|
502
|
-
204
|
503
|
-
205
|
504
|
-
206
|
505
|
-
207
|
506
|
-
208
|
507
|
-
209
|
508
|
-
210
|
509
|
-
211
|
510
|
-
212
|
511
|
-
213
|
512
|
-
214
|
513
|
-
215
|
514
|
-
216
|
515
|
-
217
|
516
|
-
218
|
517
|
-
219
|
518
|
-
220
|
519
|
-
221
|
520
|
-
222
|
521
|
-
223
|
522
|
-
224
|
523
|
-
225
|
524
|
-
226
|
525
|
-
227
|
526
|
-
228
|
527
|
-
229
|
528
|
-
230
|
529
543
|
231
|
530
544
|
232
|
531
545
|
233
|
@@ -543,10 +557,57 @@ padded into trigrams.</p>
|
|
543
557
|
245
|
544
558
|
246
|
545
559
|
247
|
546
|
-
248
|
560
|
+
248
|
561
|
+
249
|
562
|
+
250
|
563
|
+
251
|
564
|
+
252
|
565
|
+
253
|
566
|
+
254
|
567
|
+
255
|
568
|
+
256
|
569
|
+
257
|
570
|
+
258
|
571
|
+
259
|
572
|
+
260
|
573
|
+
261
|
574
|
+
262
|
575
|
+
263
|
576
|
+
264
|
577
|
+
265
|
578
|
+
266
|
579
|
+
267
|
580
|
+
268
|
581
|
+
269
|
582
|
+
270
|
583
|
+
271
|
584
|
+
272
|
585
|
+
273
|
586
|
+
274
|
587
|
+
275
|
588
|
+
276
|
589
|
+
277
|
590
|
+
278
|
591
|
+
279
|
592
|
+
280
|
593
|
+
281
|
594
|
+
282
|
595
|
+
283
|
596
|
+
284
|
597
|
+
285
|
598
|
+
286
|
599
|
+
287
|
600
|
+
288
|
601
|
+
289
|
602
|
+
290
|
603
|
+
291
|
604
|
+
292
|
605
|
+
293
|
606
|
+
294
|
607
|
+
295</pre>
|
547
608
|
</td>
|
548
609
|
<td>
|
549
|
-
<pre class="code"><span class="info file"># File 'lib/code_zauker.rb', line
|
610
|
+
<pre class="code"><span class="info file"># File 'lib/code_zauker.rb', line 231</span>
|
550
611
|
|
551
612
|
<span class='kw'>def</span> <span class='id identifier rubyid_load'>load</span><span class='lparen'>(</span><span class='id identifier rubyid_filename'>filename</span><span class='comma'>,</span> <span class='id identifier rubyid_noReload'>noReload</span><span class='op'>=</span><span class='kw'>false</span><span class='rparen'>)</span>
|
552
613
|
<span class='comment'># Define my redis id...
|
@@ -619,31 +680,33 @@ padded into trigrams.</p>
|
|
619
680
|
</div>
|
620
681
|
|
621
682
|
<div class="method_details ">
|
622
|
-
<
|
683
|
+
<h3 class="signature " id="map_ids_to_files-instance_method">
|
623
684
|
|
624
685
|
- (<tt>Object</tt>) <strong>map_ids_to_files</strong>(fileIds)
|
625
686
|
|
626
687
|
|
627
688
|
|
628
|
-
|
689
|
+
|
690
|
+
|
691
|
+
</h3><table class="source_code">
|
629
692
|
<tr>
|
630
693
|
<td>
|
631
694
|
<pre class="lines">
|
632
695
|
|
633
696
|
|
634
|
-
|
635
|
-
|
636
|
-
|
637
|
-
|
638
|
-
|
639
|
-
|
640
|
-
|
641
|
-
|
642
|
-
|
643
|
-
|
697
|
+
311
|
698
|
+
312
|
699
|
+
313
|
700
|
+
314
|
701
|
+
315
|
702
|
+
316
|
703
|
+
317
|
704
|
+
318
|
705
|
+
319
|
706
|
+
320</pre>
|
644
707
|
</td>
|
645
708
|
<td>
|
646
|
-
<pre class="code"><span class="info file"># File 'lib/code_zauker.rb', line
|
709
|
+
<pre class="code"><span class="info file"># File 'lib/code_zauker.rb', line 311</span>
|
647
710
|
|
648
711
|
<span class='kw'>def</span> <span class='id identifier rubyid_map_ids_to_files'>map_ids_to_files</span><span class='lparen'>(</span><span class='id identifier rubyid_fileIds'>fileIds</span><span class='rparen'>)</span>
|
649
712
|
<span class='id identifier rubyid_filenames'>filenames</span><span class='op'>=</span><span class='lbracket'>[</span><span class='rbracket'>]</span>
|
@@ -661,28 +724,30 @@ padded into trigrams.</p>
|
|
661
724
|
</div>
|
662
725
|
|
663
726
|
<div class="method_details ">
|
664
|
-
<
|
727
|
+
<h3 class="signature " id="reindex-instance_method">
|
665
728
|
|
666
729
|
- (<tt>Object</tt>) <strong>reindex</strong>(fileList)
|
667
730
|
|
668
731
|
|
669
732
|
|
670
|
-
|
733
|
+
|
734
|
+
|
735
|
+
</h3><table class="source_code">
|
671
736
|
<tr>
|
672
737
|
<td>
|
673
738
|
<pre class="lines">
|
674
739
|
|
675
740
|
|
676
|
-
|
677
|
-
|
678
|
-
|
679
|
-
|
680
|
-
|
681
|
-
|
682
|
-
|
741
|
+
394
|
742
|
+
395
|
743
|
+
396
|
744
|
+
397
|
745
|
+
398
|
746
|
+
399
|
747
|
+
400</pre>
|
683
748
|
</td>
|
684
749
|
<td>
|
685
|
-
<pre class="code"><span class="info file"># File 'lib/code_zauker.rb', line
|
750
|
+
<pre class="code"><span class="info file"># File 'lib/code_zauker.rb', line 394</span>
|
686
751
|
|
687
752
|
<span class='kw'>def</span> <span class='id identifier rubyid_reindex'>reindex</span><span class='lparen'>(</span><span class='id identifier rubyid_fileList'>fileList</span><span class='rparen'>)</span>
|
688
753
|
<span class='comment'>#puts "Reindexing... #{fileList.length} files..."
|
@@ -697,13 +762,15 @@ padded into trigrams.</p>
|
|
697
762
|
</div>
|
698
763
|
|
699
764
|
<div class="method_details ">
|
700
|
-
<
|
765
|
+
<h3 class="signature " id="remove-instance_method">
|
701
766
|
|
702
767
|
- (<tt>Object</tt>) <strong>remove</strong>(filePaths = nil)
|
703
768
|
|
704
769
|
|
705
770
|
|
706
|
-
|
771
|
+
|
772
|
+
|
773
|
+
</h3><div class="docstring">
|
707
774
|
<div class="discussion">
|
708
775
|
|
709
776
|
<p>Remove the files from the index, updating trigrams</p>
|
@@ -720,45 +787,45 @@ padded into trigrams.</p>
|
|
720
787
|
<pre class="lines">
|
721
788
|
|
722
789
|
|
723
|
-
|
724
|
-
|
725
|
-
|
726
|
-
|
727
|
-
|
728
|
-
|
729
|
-
|
730
|
-
|
731
|
-
|
732
|
-
|
733
|
-
|
734
|
-
|
735
|
-
|
736
|
-
|
737
|
-
|
738
|
-
|
739
|
-
|
740
|
-
|
741
|
-
|
742
|
-
|
743
|
-
|
744
|
-
|
745
|
-
|
746
|
-
|
747
|
-
|
748
|
-
|
749
|
-
|
750
|
-
|
751
|
-
|
752
|
-
|
753
|
-
|
754
|
-
|
755
|
-
|
756
|
-
|
757
|
-
|
758
|
-
|
790
|
+
415
|
791
|
+
416
|
792
|
+
417
|
793
|
+
418
|
794
|
+
419
|
795
|
+
420
|
796
|
+
421
|
797
|
+
422
|
798
|
+
423
|
799
|
+
424
|
800
|
+
425
|
801
|
+
426
|
802
|
+
427
|
803
|
+
428
|
804
|
+
429
|
805
|
+
430
|
806
|
+
431
|
807
|
+
432
|
808
|
+
433
|
809
|
+
434
|
810
|
+
435
|
811
|
+
436
|
812
|
+
437
|
813
|
+
438
|
814
|
+
439
|
815
|
+
440
|
816
|
+
441
|
817
|
+
442
|
818
|
+
443
|
819
|
+
444
|
820
|
+
445
|
821
|
+
446
|
822
|
+
447
|
823
|
+
448
|
824
|
+
449
|
825
|
+
450</pre>
|
759
826
|
</td>
|
760
827
|
<td>
|
761
|
-
<pre class="code"><span class="info file"># File 'lib/code_zauker.rb', line
|
828
|
+
<pre class="code"><span class="info file"># File 'lib/code_zauker.rb', line 415</span>
|
762
829
|
|
763
830
|
<span class='kw'>def</span> <span class='id identifier rubyid_remove'>remove</span><span class='lparen'>(</span><span class='id identifier rubyid_filePaths'>filePaths</span><span class='op'>=</span><span class='kw'>nil</span><span class='rparen'>)</span>
|
764
831
|
<span class='kw'>if</span> <span class='id identifier rubyid_filePaths'>filePaths</span><span class='op'>==</span><span class='kw'>nil</span>
|
@@ -802,13 +869,15 @@ padded into trigrams.</p>
|
|
802
869
|
</div>
|
803
870
|
|
804
871
|
<div class="method_details ">
|
805
|
-
<
|
872
|
+
<h3 class="signature " id="removeAll-instance_method">
|
806
873
|
|
807
874
|
- (<tt>Object</tt>) <strong>removeAll</strong>
|
808
875
|
|
809
876
|
|
810
877
|
|
811
|
-
|
878
|
+
|
879
|
+
|
880
|
+
</h3><div class="docstring">
|
812
881
|
<div class="discussion">
|
813
882
|
|
814
883
|
<p>Remove all the keys</p>
|
@@ -825,19 +894,19 @@ padded into trigrams.</p>
|
|
825
894
|
<pre class="lines">
|
826
895
|
|
827
896
|
|
828
|
-
|
829
|
-
|
830
|
-
|
831
|
-
|
832
|
-
|
833
|
-
|
834
|
-
|
835
|
-
|
836
|
-
|
837
|
-
|
897
|
+
403
|
898
|
+
404
|
899
|
+
405
|
900
|
+
406
|
901
|
+
407
|
902
|
+
408
|
903
|
+
409
|
904
|
+
410
|
905
|
+
411
|
906
|
+
412</pre>
|
838
907
|
</td>
|
839
908
|
<td>
|
840
|
-
<pre class="code"><span class="info file"># File 'lib/code_zauker.rb', line
|
909
|
+
<pre class="code"><span class="info file"># File 'lib/code_zauker.rb', line 403</span>
|
841
910
|
|
842
911
|
<span class='kw'>def</span> <span class='id identifier rubyid_removeAll'>removeAll</span><span class='lparen'>(</span><span class='rparen'>)</span>
|
843
912
|
<span class='id identifier rubyid_tokill'>tokill</span><span class='op'>=</span><span class='lbracket'>[</span><span class='rbracket'>]</span>
|
@@ -855,13 +924,15 @@ padded into trigrams.</p>
|
|
855
924
|
</div>
|
856
925
|
|
857
926
|
<div class="method_details ">
|
858
|
-
<
|
927
|
+
<h3 class="signature " id="search-instance_method">
|
859
928
|
|
860
929
|
- (<tt>Object</tt>) <strong>search</strong>(term)
|
861
930
|
|
862
931
|
|
863
932
|
|
864
|
-
|
933
|
+
|
934
|
+
|
935
|
+
</h3><div class="docstring">
|
865
936
|
<div class="discussion">
|
866
937
|
|
867
938
|
<h1>search</h1>
|
@@ -881,24 +952,24 @@ padded into trigrams</p>
|
|
881
952
|
<pre class="lines">
|
882
953
|
|
883
954
|
|
884
|
-
|
885
|
-
|
886
|
-
|
887
|
-
|
888
|
-
|
889
|
-
|
890
|
-
|
891
|
-
|
892
|
-
|
893
|
-
|
894
|
-
|
895
|
-
|
896
|
-
|
897
|
-
|
898
|
-
|
955
|
+
378
|
956
|
+
379
|
957
|
+
380
|
958
|
+
381
|
959
|
+
382
|
960
|
+
383
|
961
|
+
384
|
962
|
+
385
|
963
|
+
386
|
964
|
+
387
|
965
|
+
388
|
966
|
+
389
|
967
|
+
390
|
968
|
+
391
|
969
|
+
392</pre>
|
899
970
|
</td>
|
900
971
|
<td>
|
901
|
-
<pre class="code"><span class="info file"># File 'lib/code_zauker.rb', line
|
972
|
+
<pre class="code"><span class="info file"># File 'lib/code_zauker.rb', line 378</span>
|
902
973
|
|
903
974
|
<span class='kw'>def</span> <span class='id identifier rubyid_search'>search</span><span class='lparen'>(</span><span class='id identifier rubyid_term'>term</span><span class='rparen'>)</span>
|
904
975
|
<span class='kw'>if</span> <span class='id identifier rubyid_term'>term</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span> <span class='op'><</span> <span class='const'>GRAM_SIZE</span>
|
@@ -920,14 +991,110 @@ padded into trigrams</p>
|
|
920
991
|
</table>
|
921
992
|
</div>
|
922
993
|
|
994
|
+
<div class="method_details ">
|
995
|
+
<h3 class="signature " id="wsearch-instance_method">
|
996
|
+
|
997
|
+
- (<tt>Object</tt>) <strong>wsearch</strong>(term)
|
998
|
+
|
999
|
+
|
1000
|
+
|
1001
|
+
|
1002
|
+
|
1003
|
+
</h3><div class="docstring">
|
1004
|
+
<div class="discussion">
|
1005
|
+
|
1006
|
+
<h1>wild cards search</h1>
|
1007
|
+
|
1008
|
+
<p>You can search trigram in the form public*class*Apple will match java
|
1009
|
+
declaration of MyApple but not YourAppManager</p>
|
1010
|
+
|
1011
|
+
|
923
1012
|
</div>
|
1013
|
+
</div>
|
1014
|
+
<div class="tags">
|
1015
|
+
|
924
1016
|
|
1017
|
+
</div><table class="source_code">
|
1018
|
+
<tr>
|
1019
|
+
<td>
|
1020
|
+
<pre class="lines">
|
1021
|
+
|
1022
|
+
|
1023
|
+
344
|
1024
|
+
345
|
1025
|
+
346
|
1026
|
+
347
|
1027
|
+
348
|
1028
|
+
349
|
1029
|
+
350
|
1030
|
+
351
|
1031
|
+
352
|
1032
|
+
353
|
1033
|
+
354
|
1034
|
+
355
|
1035
|
+
356
|
1036
|
+
357
|
1037
|
+
358
|
1038
|
+
359
|
1039
|
+
360
|
1040
|
+
361
|
1041
|
+
362
|
1042
|
+
363
|
1043
|
+
364
|
1044
|
+
365
|
1045
|
+
366
|
1046
|
+
367
|
1047
|
+
368
|
1048
|
+
369
|
1049
|
+
370
|
1050
|
+
371
|
1051
|
+
372</pre>
|
1052
|
+
</td>
|
1053
|
+
<td>
|
1054
|
+
<pre class="code"><span class="info file"># File 'lib/code_zauker.rb', line 344</span>
|
1055
|
+
|
1056
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_wsearch'>wsearch</span><span class='lparen'>(</span><span class='id identifier rubyid_term'>term</span><span class='rparen'>)</span>
|
1057
|
+
<span class='comment'># Split stuff
|
1058
|
+
</span> <span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Wild Search request:</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_term'>term</span><span class='rbrace'>}</span><span class='tstring_end'>"</span></span>
|
1059
|
+
<span class='id identifier rubyid_m'>m</span><span class='op'>=</span><span class='id identifier rubyid_term'>term</span><span class='period'>.</span><span class='id identifier rubyid_split'>split</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>*</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
1060
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_m'>m</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span><span class='op'>></span><span class='int'>0</span>
|
1061
|
+
<span class='id identifier rubyid_trigramInAnd'>trigramInAnd</span><span class='op'>=</span><span class='const'>Set</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='rparen'>)</span>
|
1062
|
+
<span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>*= Found:</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_m'>m</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span><span class='rbrace'>}</span><span class='tstring_end'>"</span></span>
|
1063
|
+
<span class='id identifier rubyid_m'>m</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span> <span class='id identifier rubyid_wtc'>wtc</span> <span class='op'>|</span>
|
1064
|
+
<span class='id identifier rubyid_wt'>wt</span><span class='op'>=</span><span class='id identifier rubyid_wtc'>wtc</span><span class='period'>.</span><span class='id identifier rubyid_downcase'>downcase</span><span class='lparen'>(</span><span class='rparen'>)</span>
|
1065
|
+
<span class='comment'>#puts "Splitting #{wt}"
|
1066
|
+
</span> <span class='id identifier rubyid_trigSet'>trigSet</span><span class='op'>=</span><span class='id identifier rubyid_split_in_trigrams'>split_in_trigrams</span><span class='lparen'>(</span><span class='id identifier rubyid_wt'>wt</span><span class='comma'>,</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>trigram:ci</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
1067
|
+
<span class='id identifier rubyid_trigramInAnd'>trigramInAnd</span><span class='op'>=</span><span class='id identifier rubyid_trigramInAnd'>trigramInAnd</span><span class='period'>.</span><span class='id identifier rubyid_merge'>merge</span><span class='lparen'>(</span><span class='id identifier rubyid_trigSet'>trigSet</span><span class='rparen'>)</span>
|
1068
|
+
<span class='kw'>end</span>
|
1069
|
+
<span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Trigrams: </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_trigramInAnd'>trigramInAnd</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span><span class='rbrace'>}</span><span class='tstring_end'>"</span></span>
|
1070
|
+
<span class='id identifier rubyid_trigramInAnd'>trigramInAnd</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span> <span class='id identifier rubyid_x'>x</span> <span class='op'>|</span>
|
1071
|
+
<span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_x'>x</span><span class='rbrace'>}</span><span class='tstring_end'>"</span></span>
|
1072
|
+
<span class='kw'>end</span>
|
1073
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_trigramInAnd'>trigramInAnd</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span><span class='op'>==</span><span class='int'>0</span>
|
1074
|
+
<span class='kw'>return</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
|
1075
|
+
<span class='kw'>end</span>
|
1076
|
+
<span class='id identifier rubyid_fileIds'>fileIds</span><span class='op'>=</span><span class='ivar'>@redis</span><span class='period'>.</span><span class='id identifier rubyid_sinter'>sinter</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_trigramInAnd'>trigramInAnd</span><span class='rparen'>)</span>
|
1077
|
+
<span class='id identifier rubyid_fileNames'>fileNames</span><span class='op'>=</span><span class='id identifier rubyid_map_ids_to_files'>map_ids_to_files</span><span class='lparen'>(</span><span class='id identifier rubyid_fileIds'>fileIds</span><span class='rparen'>)</span>
|
1078
|
+
<span class='comment'>#puts "DEBUG #{fileIds} #{fileNames}"
|
1079
|
+
</span> <span class='kw'>return</span> <span class='id identifier rubyid_fileNames'>fileNames</span>
|
1080
|
+
<span class='kw'>else</span>
|
1081
|
+
<span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Warn no Wild!</span><span class='tstring_end'>"</span></span>
|
1082
|
+
<span class='kw'>return</span> <span class='id identifier rubyid_search'>search</span><span class='lparen'>(</span><span class='id identifier rubyid_term'>term</span><span class='rparen'>)</span>
|
1083
|
+
<span class='kw'>end</span>
|
1084
|
+
<span class='kw'>end</span></pre>
|
1085
|
+
</td>
|
1086
|
+
</tr>
|
1087
|
+
</table>
|
925
1088
|
</div>
|
926
1089
|
|
1090
|
+
</div>
|
1091
|
+
|
1092
|
+
</div>
|
1093
|
+
|
927
1094
|
<div id="footer">
|
928
|
-
Generated on
|
1095
|
+
Generated on Wed May 16 17:14:54 2012 by
|
929
1096
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
930
|
-
0.
|
1097
|
+
0.8.1 (ruby-1.9.3).
|
931
1098
|
</div>
|
932
1099
|
|
933
1100
|
</body>
|