swishe 0.4.2 → 0.4.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (6) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +10 -0
  3. data/ext/swish-e.i +1 -1
  4. data/ext/swishe_base.c +106 -168
  5. data/setup.rb +6 -2
  6. metadata +12 -14
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cd705daa29622afb11ac666f6f9549bd987e3d04
4
- data.tar.gz: 790b37559650d35ac615fa4a2479468d7dba67e2
3
+ metadata.gz: da0a08886033bc0389fef7019042db6b1c4f5fb1
4
+ data.tar.gz: 9e3066e4787321d8c66e2bad9aed6980153e3d57
5
5
  SHA512:
6
- metadata.gz: dec15f3ff2498d42d561c9c1a291921f6f4c79d99e865163114e5cde7217ed6bd71d2370e3eb1d1a94dedf7dc96e73fba6a6448d98fe269a0bbb752cff69c032
7
- data.tar.gz: b70ce90724d4892a16589fa2414602da6e711ad41641e94d93ba431412bbac432a21e7189a74a3a478eaaeadc67c156e06d6137fa709e674d6e0a98be2be140d
6
+ metadata.gz: a519bee897f41a0b52997d4a4cbff10f0c461ff3c768ae3cf1831eca74dc3ff37d3542519d88ec6905b8c1b6d44901e09465538814f963c1a5a867d65d08f321
7
+ data.tar.gz: af456461c5b9bc7815cea4b548b68dcb354e027e13fb496ab704f9f7261edf959e75996111bb2878a428f6a63aac6423e60623eb3a68674b5e1fcd8b499862c9
data/README.md CHANGED
@@ -45,6 +45,16 @@ and again, if your system doesn't find the Swish-e library, you need to supply t
45
45
 
46
46
  Needles to say that you need to change the path according to your system requirements.
47
47
 
48
+ ## Bundler
49
+
50
+ In your Gemfile, add:
51
+
52
+ gem 'swishe', :git => 'git://github.com/nspring/swish-e-gem.git'
53
+
54
+ Of course, you'll need swish-e with development headers
55
+ installed `brew install swish-e` or `apt-get install
56
+ swish-e-dev`.
57
+
48
58
  ## Other Stuff
49
59
  Author:: Patrick Gundlach <patrick <at> gundla.ch>
50
60
 
@@ -147,7 +147,7 @@ const char *SwishWordsByLetter(SW_HANDLE, char *filename, char c);
147
147
  char *SwishStemWord( SW_HANDLE, char *word ); /* Really this is depreciated */
148
148
 
149
149
  SW_FUZZYWORD SwishFuzzyWord( SW_RESULT r, char *word );
150
- SW_FUZZYWORD SwishFuzzy( SW_HANDLE sw, const char *index_name, char *word );
150
+ /* not present 2.4.7 SW_FUZZYWORD SwishFuzzy( SW_HANDLE sw, const char *index_name, char *word ); */
151
151
  const char **SwishFuzzyWordList( SW_FUZZYWORD fw );
152
152
  int SwishFuzzyWordCount( SW_FUZZYWORD fw );
153
153
  int SwishFuzzyWordError( SW_FUZZYWORD fw );
@@ -1,11 +1,11 @@
1
1
  /* ----------------------------------------------------------------------------
2
2
  * This file was automatically generated by SWIG (http://www.swig.org).
3
- * Version 2.0.7
4
- *
5
- * This file is not intended to be easily readable and contains a number of
3
+ * Version 2.0.12
4
+ *
5
+ * This file is not intended to be easily readable and contains a number of
6
6
  * coding conventions designed to improve portability and efficiency. Do not make
7
- * changes to this file unless you know what you are doing--modify the SWIG
8
- * interface file instead.
7
+ * changes to this file unless you know what you are doing--modify the SWIG
8
+ * interface file instead.
9
9
  * ----------------------------------------------------------------------------- */
10
10
 
11
11
  #define SWIGRUBY
@@ -41,28 +41,28 @@
41
41
  #ifndef SWIGUNUSED
42
42
  # if defined(__GNUC__)
43
43
  # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
44
- # define SWIGUNUSED __attribute__ ((__unused__))
44
+ # define SWIGUNUSED __attribute__ ((__unused__))
45
45
  # else
46
46
  # define SWIGUNUSED
47
47
  # endif
48
48
  # elif defined(__ICC)
49
- # define SWIGUNUSED __attribute__ ((__unused__))
49
+ # define SWIGUNUSED __attribute__ ((__unused__))
50
50
  # else
51
- # define SWIGUNUSED
51
+ # define SWIGUNUSED
52
52
  # endif
53
53
  #endif
54
54
 
55
55
  #ifndef SWIG_MSC_UNSUPPRESS_4505
56
56
  # if defined(_MSC_VER)
57
57
  # pragma warning(disable : 4505) /* unreferenced local function has been removed */
58
- # endif
58
+ # endif
59
59
  #endif
60
60
 
61
61
  #ifndef SWIGUNUSEDPARM
62
62
  # ifdef __cplusplus
63
63
  # define SWIGUNUSEDPARM(p)
64
64
  # else
65
- # define SWIGUNUSEDPARM(p) p SWIGUNUSED
65
+ # define SWIGUNUSEDPARM(p) p SWIGUNUSED
66
66
  # endif
67
67
  #endif
68
68
 
@@ -105,7 +105,7 @@
105
105
  # define SWIGSTDCALL __stdcall
106
106
  # else
107
107
  # define SWIGSTDCALL
108
- # endif
108
+ # endif
109
109
  #endif
110
110
 
111
111
  /* Deal with Microsoft's attempt at deprecating C standard runtime functions */
@@ -150,28 +150,28 @@
150
150
  #ifndef SWIGUNUSED
151
151
  # if defined(__GNUC__)
152
152
  # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
153
- # define SWIGUNUSED __attribute__ ((__unused__))
153
+ # define SWIGUNUSED __attribute__ ((__unused__))
154
154
  # else
155
155
  # define SWIGUNUSED
156
156
  # endif
157
157
  # elif defined(__ICC)
158
- # define SWIGUNUSED __attribute__ ((__unused__))
158
+ # define SWIGUNUSED __attribute__ ((__unused__))
159
159
  # else
160
- # define SWIGUNUSED
160
+ # define SWIGUNUSED
161
161
  # endif
162
162
  #endif
163
163
 
164
164
  #ifndef SWIG_MSC_UNSUPPRESS_4505
165
165
  # if defined(_MSC_VER)
166
166
  # pragma warning(disable : 4505) /* unreferenced local function has been removed */
167
- # endif
167
+ # endif
168
168
  #endif
169
169
 
170
170
  #ifndef SWIGUNUSEDPARM
171
171
  # ifdef __cplusplus
172
172
  # define SWIGUNUSEDPARM(p)
173
173
  # else
174
- # define SWIGUNUSEDPARM(p) p SWIGUNUSED
174
+ # define SWIGUNUSEDPARM(p) p SWIGUNUSED
175
175
  # endif
176
176
  #endif
177
177
 
@@ -214,7 +214,7 @@
214
214
  # define SWIGSTDCALL __stdcall
215
215
  # else
216
216
  # define SWIGSTDCALL
217
- # endif
217
+ # endif
218
218
  #endif
219
219
 
220
220
  /* Deal with Microsoft's attempt at deprecating C standard runtime functions */
@@ -252,7 +252,7 @@
252
252
  You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for
253
253
  creating a static or dynamic library from the SWIG runtime code.
254
254
  In 99.9% of the cases, SWIG just needs to declare them as 'static'.
255
-
255
+
256
256
  But only do this if strictly necessary, ie, if you have problems
257
257
  with your compiler or suchlike.
258
258
  */
@@ -278,16 +278,16 @@
278
278
  #define SWIG_POINTER_OWN 0x1
279
279
 
280
280
 
281
- /*
281
+ /*
282
282
  Flags/methods for returning states.
283
-
284
- The SWIG conversion methods, as ConvertPtr, return an integer
283
+
284
+ The SWIG conversion methods, as ConvertPtr, return an integer
285
285
  that tells if the conversion was successful or not. And if not,
286
286
  an error code can be returned (see swigerrors.swg for the codes).
287
-
287
+
288
288
  Use the following macros/flags to set or process the returning
289
289
  states.
290
-
290
+
291
291
  In old versions of SWIG, code such as the following was usually written:
292
292
 
293
293
  if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) {
@@ -320,23 +320,23 @@
320
320
  } else {
321
321
  // fail code
322
322
  }
323
-
323
+
324
324
  I.e., now SWIG_ConvertPtr can return new objects and you can
325
325
  identify the case and take care of the deallocation. Of course that
326
326
  also requires SWIG_ConvertPtr to return new result values, such as
327
327
 
328
- int SWIG_ConvertPtr(obj, ptr,...) {
329
- if (<obj is ok>) {
330
- if (<need new object>) {
331
- *ptr = <ptr to new allocated object>;
332
- return SWIG_NEWOBJ;
333
- } else {
334
- *ptr = <ptr to old object>;
335
- return SWIG_OLDOBJ;
336
- }
337
- } else {
338
- return SWIG_BADOBJ;
339
- }
328
+ int SWIG_ConvertPtr(obj, ptr,...) {
329
+ if (<obj is ok>) {
330
+ if (<need new object>) {
331
+ *ptr = <ptr to new allocated object>;
332
+ return SWIG_NEWOBJ;
333
+ } else {
334
+ *ptr = <ptr to old object>;
335
+ return SWIG_OLDOBJ;
336
+ }
337
+ } else {
338
+ return SWIG_BADOBJ;
339
+ }
340
340
  }
341
341
 
342
342
  Of course, returning the plain '0(success)/-1(fail)' still works, but you can be
@@ -350,17 +350,17 @@
350
350
  int fooi(int);
351
351
 
352
352
  and you call
353
-
353
+
354
354
  food(1) // cast rank '1' (1 -> 1.0)
355
355
  fooi(1) // cast rank '0'
356
356
 
357
357
  just use the SWIG_AddCast()/SWIG_CheckState()
358
358
  */
359
359
 
360
- #define SWIG_OK (0)
360
+ #define SWIG_OK (0)
361
361
  #define SWIG_ERROR (-1)
362
362
  #define SWIG_IsOK(r) (r >= 0)
363
- #define SWIG_ArgError(r) ((r != SWIG_ERROR) ? r : SWIG_TypeError)
363
+ #define SWIG_ArgError(r) ((r != SWIG_ERROR) ? r : SWIG_TypeError)
364
364
 
365
365
  /* The CastRankLimit says how many bits are used for the cast rank */
366
366
  #define SWIG_CASTRANKLIMIT (1 << 8)
@@ -391,14 +391,14 @@
391
391
  # endif
392
392
  # define SWIG_CASTRANKMASK ((SWIG_CASTRANKLIMIT) -1)
393
393
  # define SWIG_CastRank(r) (r & SWIG_CASTRANKMASK)
394
- SWIGINTERNINLINE int SWIG_AddCast(int r) {
394
+ SWIGINTERNINLINE int SWIG_AddCast(int r) {
395
395
  return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r;
396
396
  }
397
- SWIGINTERNINLINE int SWIG_CheckState(int r) {
398
- return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0;
397
+ SWIGINTERNINLINE int SWIG_CheckState(int r) {
398
+ return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0;
399
399
  }
400
400
  #else /* no cast-rank mode */
401
- # define SWIG_AddCast
401
+ # define SWIG_AddCast(r) (r)
402
402
  # define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0)
403
403
  #endif
404
404
 
@@ -442,7 +442,7 @@ typedef struct swig_module_info {
442
442
  void *clientdata; /* Language specific module data */
443
443
  } swig_module_info;
444
444
 
445
- /*
445
+ /*
446
446
  Compare two type names skipping the space characters, therefore
447
447
  "char*" == "char *" and "Class<int>" == "Class<int >", etc.
448
448
 
@@ -462,18 +462,18 @@ SWIG_TypeNameComp(const char *f1, const char *l1,
462
462
 
463
463
  /*
464
464
  Check type equivalence in a name list like <name1>|<name2>|...
465
- Return 0 if not equal, 1 if equal
465
+ Return 0 if equal, -1 if nb < tb, 1 if nb > tb
466
466
  */
467
467
  SWIGRUNTIME int
468
- SWIG_TypeEquiv(const char *nb, const char *tb) {
469
- int equiv = 0;
468
+ SWIG_TypeCmp(const char *nb, const char *tb) {
469
+ int equiv = 1;
470
470
  const char* te = tb + strlen(tb);
471
471
  const char* ne = nb;
472
- while (!equiv && *ne) {
472
+ while (equiv != 0 && *ne) {
473
473
  for (nb = ne; *ne; ++ne) {
474
474
  if (*ne == '|') break;
475
475
  }
476
- equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
476
+ equiv = SWIG_TypeNameComp(nb, ne, tb, te);
477
477
  if (*ne) ++ne;
478
478
  }
479
479
  return equiv;
@@ -481,24 +481,13 @@ SWIG_TypeEquiv(const char *nb, const char *tb) {
481
481
 
482
482
  /*
483
483
  Check type equivalence in a name list like <name1>|<name2>|...
484
- Return 0 if equal, -1 if nb < tb, 1 if nb > tb
484
+ Return 0 if not equal, 1 if equal
485
485
  */
486
486
  SWIGRUNTIME int
487
- SWIG_TypeCompare(const char *nb, const char *tb) {
488
- int equiv = 0;
489
- const char* te = tb + strlen(tb);
490
- const char* ne = nb;
491
- while (!equiv && *ne) {
492
- for (nb = ne; *ne; ++ne) {
493
- if (*ne == '|') break;
494
- }
495
- equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
496
- if (*ne) ++ne;
497
- }
498
- return equiv;
487
+ SWIG_TypeEquiv(const char *nb, const char *tb) {
488
+ return SWIG_TypeCmp(nb, tb) == 0 ? 1 : 0;
499
489
  }
500
490
 
501
-
502
491
  /*
503
492
  Check the typename
504
493
  */
@@ -526,7 +515,7 @@ SWIG_TypeCheck(const char *c, swig_type_info *ty) {
526
515
  return 0;
527
516
  }
528
517
 
529
- /*
518
+ /*
530
519
  Identical to SWIG_TypeCheck, except strcmp is replaced with a pointer comparison
531
520
  */
532
521
  SWIGRUNTIME swig_cast_info *
@@ -561,7 +550,7 @@ SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) {
561
550
  return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory);
562
551
  }
563
552
 
564
- /*
553
+ /*
565
554
  Dynamic pointer casting. Down an inheritance hierarchy
566
555
  */
567
556
  SWIGRUNTIME swig_type_info *
@@ -605,7 +594,7 @@ SWIG_TypePrettyName(const swig_type_info *type) {
605
594
  return type->name;
606
595
  }
607
596
 
608
- /*
597
+ /*
609
598
  Set the clientdata field for a type
610
599
  */
611
600
  SWIGRUNTIME void
@@ -613,14 +602,14 @@ SWIG_TypeClientData(swig_type_info *ti, void *clientdata) {
613
602
  swig_cast_info *cast = ti->cast;
614
603
  /* if (ti->clientdata == clientdata) return; */
615
604
  ti->clientdata = clientdata;
616
-
605
+
617
606
  while (cast) {
618
607
  if (!cast->converter) {
619
608
  swig_type_info *tc = cast->type;
620
609
  if (!tc->clientdata) {
621
610
  SWIG_TypeClientData(tc, clientdata);
622
611
  }
623
- }
612
+ }
624
613
  cast = cast->next;
625
614
  }
626
615
  }
@@ -629,18 +618,18 @@ SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) {
629
618
  SWIG_TypeClientData(ti, clientdata);
630
619
  ti->owndata = 1;
631
620
  }
632
-
621
+
633
622
  /*
634
623
  Search for a swig_type_info structure only by mangled name
635
624
  Search is a O(log #types)
636
-
637
- We start searching at module start, and finish searching when start == end.
625
+
626
+ We start searching at module start, and finish searching when start == end.
638
627
  Note: if start == end at the beginning of the function, we go all the way around
639
628
  the circular list.
640
629
  */
641
630
  SWIGRUNTIME swig_type_info *
642
- SWIG_MangledTypeQueryModule(swig_module_info *start,
643
- swig_module_info *end,
631
+ SWIG_MangledTypeQueryModule(swig_module_info *start,
632
+ swig_module_info *end,
644
633
  const char *name) {
645
634
  swig_module_info *iter = start;
646
635
  do {
@@ -649,11 +638,11 @@ SWIG_MangledTypeQueryModule(swig_module_info *start,
649
638
  register size_t r = iter->size - 1;
650
639
  do {
651
640
  /* since l+r >= 0, we can (>> 1) instead (/ 2) */
652
- register size_t i = (l + r) >> 1;
641
+ register size_t i = (l + r) >> 1;
653
642
  const char *iname = iter->types[i]->name;
654
643
  if (iname) {
655
644
  register int compare = strcmp(name, iname);
656
- if (compare == 0) {
645
+ if (compare == 0) {
657
646
  return iter->types[i];
658
647
  } else if (compare < 0) {
659
648
  if (i) {
@@ -678,14 +667,14 @@ SWIG_MangledTypeQueryModule(swig_module_info *start,
678
667
  Search for a swig_type_info structure for either a mangled name or a human readable name.
679
668
  It first searches the mangled names of the types, which is a O(log #types)
680
669
  If a type is not found it then searches the human readable names, which is O(#types).
681
-
682
- We start searching at module start, and finish searching when start == end.
670
+
671
+ We start searching at module start, and finish searching when start == end.
683
672
  Note: if start == end at the beginning of the function, we go all the way around
684
673
  the circular list.
685
674
  */
686
675
  SWIGRUNTIME swig_type_info *
687
- SWIG_TypeQueryModule(swig_module_info *start,
688
- swig_module_info *end,
676
+ SWIG_TypeQueryModule(swig_module_info *start,
677
+ swig_module_info *end,
689
678
  const char *name) {
690
679
  /* STEP 1: Search the name field using binary search */
691
680
  swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name);
@@ -704,12 +693,12 @@ SWIG_TypeQueryModule(swig_module_info *start,
704
693
  iter = iter->next;
705
694
  } while (iter != end);
706
695
  }
707
-
696
+
708
697
  /* neither found a match */
709
698
  return 0;
710
699
  }
711
700
 
712
- /*
701
+ /*
713
702
  Pack binary data into a string
714
703
  */
715
704
  SWIGRUNTIME char *
@@ -725,7 +714,7 @@ SWIG_PackData(char *c, void *ptr, size_t sz) {
725
714
  return c;
726
715
  }
727
716
 
728
- /*
717
+ /*
729
718
  Unpack binary data from a string
730
719
  */
731
720
  SWIGRUNTIME const char *
@@ -739,21 +728,21 @@ SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
739
728
  uu = ((d - '0') << 4);
740
729
  else if ((d >= 'a') && (d <= 'f'))
741
730
  uu = ((d - ('a'-10)) << 4);
742
- else
731
+ else
743
732
  return (char *) 0;
744
733
  d = *(c++);
745
734
  if ((d >= '0') && (d <= '9'))
746
735
  uu |= (d - '0');
747
736
  else if ((d >= 'a') && (d <= 'f'))
748
737
  uu |= (d - ('a'-10));
749
- else
738
+ else
750
739
  return (char *) 0;
751
740
  *u = uu;
752
741
  }
753
742
  return c;
754
743
  }
755
744
 
756
- /*
745
+ /*
757
746
  Pack 'void *' into a string buffer.
758
747
  */
759
748
  SWIGRUNTIME char *
@@ -813,18 +802,18 @@ SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
813
802
  #endif
814
803
 
815
804
  /* Errors in SWIG */
816
- #define SWIG_UnknownError -1
817
- #define SWIG_IOError -2
818
- #define SWIG_RuntimeError -3
819
- #define SWIG_IndexError -4
820
- #define SWIG_TypeError -5
821
- #define SWIG_DivisionByZero -6
822
- #define SWIG_OverflowError -7
823
- #define SWIG_SyntaxError -8
824
- #define SWIG_ValueError -9
805
+ #define SWIG_UnknownError -1
806
+ #define SWIG_IOError -2
807
+ #define SWIG_RuntimeError -3
808
+ #define SWIG_IndexError -4
809
+ #define SWIG_TypeError -5
810
+ #define SWIG_DivisionByZero -6
811
+ #define SWIG_OverflowError -7
812
+ #define SWIG_SyntaxError -8
813
+ #define SWIG_ValueError -9
825
814
  #define SWIG_SystemError -10
826
815
  #define SWIG_AttributeError -11
827
- #define SWIG_MemoryError -12
816
+ #define SWIG_MemoryError -12
828
817
  #define SWIG_NullReferenceError -13
829
818
 
830
819
 
@@ -1374,7 +1363,7 @@ SWIG_Ruby_AppendOutput(VALUE target, VALUE o) {
1374
1363
 
1375
1364
  /* Runtime API */
1376
1365
 
1377
- #define SWIG_GetModule(clientdata) SWIG_Ruby_GetModule()
1366
+ #define SWIG_GetModule(clientdata) SWIG_Ruby_GetModule(clientdata)
1378
1367
  #define SWIG_SetModule(clientdata, pointer) SWIG_Ruby_SetModule(pointer)
1379
1368
 
1380
1369
 
@@ -1710,7 +1699,7 @@ SWIG_Ruby_ConvertPacked(VALUE obj, void *ptr, int sz, swig_type_info *ty) {
1710
1699
  }
1711
1700
 
1712
1701
  SWIGRUNTIME swig_module_info *
1713
- SWIG_Ruby_GetModule(void)
1702
+ SWIG_Ruby_GetModule(void *SWIGUNUSEDPARM(clientdata))
1714
1703
  {
1715
1704
  VALUE pointer;
1716
1705
  swig_module_info *ret = 0;
@@ -1750,7 +1739,7 @@ SWIG_Ruby_SetModule(swig_module_info *pointer)
1750
1739
  SWIGINTERN
1751
1740
  int SWIG_Ruby_isCallable( VALUE proc )
1752
1741
  {
1753
- if ( rb_respond_to( proc, swig_call_id ) == Qtrue )
1742
+ if ( rb_respond_to( proc, swig_call_id ) )
1754
1743
  return 1;
1755
1744
  return 0;
1756
1745
  }
@@ -1763,7 +1752,7 @@ int SWIG_Ruby_isCallable( VALUE proc )
1763
1752
  SWIGINTERN
1764
1753
  int SWIG_Ruby_arity( VALUE proc, int minimal )
1765
1754
  {
1766
- if ( rb_respond_to( proc, swig_arity_id ) == Qtrue )
1755
+ if ( rb_respond_to( proc, swig_arity_id ) )
1767
1756
  {
1768
1757
  VALUE num = rb_funcall( proc, swig_arity_id, 0 );
1769
1758
  int arity = NUM2INT(num);
@@ -1816,7 +1805,7 @@ static VALUE mSwishe_base;
1816
1805
  #define SWIG_RUBY_THREAD_END_BLOCK
1817
1806
 
1818
1807
 
1819
- #define SWIGVERSION 0x020007
1808
+ #define SWIGVERSION 0x020012
1820
1809
  #define SWIG_VERSION SWIGVERSION
1821
1810
 
1822
1811
 
@@ -1866,11 +1855,7 @@ SWIGINTERN int
1866
1855
  SWIG_AsCharPtrAndSize(VALUE obj, char** cptr, size_t* psize, int *alloc)
1867
1856
  {
1868
1857
  if (TYPE(obj) == T_STRING) {
1869
- #if defined(StringValuePtr)
1870
1858
  char *cstr = StringValuePtr(obj);
1871
- #else
1872
- char *cstr = STR2CSTR(obj);
1873
- #endif
1874
1859
  size_t size = RSTRING_LEN(obj) + 1;
1875
1860
  if (cptr) {
1876
1861
  if (alloc) {
@@ -1934,7 +1919,7 @@ SWIG_ruby_failed(void)
1934
1919
  }
1935
1920
 
1936
1921
 
1937
- /*@SWIG:/usr/local/Cellar/swig/2.0.7/share/swig/2.0.7/ruby/rubyprimtypes.swg,19,%ruby_aux_method@*/
1922
+ /*@SWIG:/usr/share/swig2.0/ruby/rubyprimtypes.swg,19,%ruby_aux_method@*/
1938
1923
  SWIGINTERN VALUE SWIG_AUX_NUM2ULONG(VALUE *args)
1939
1924
  {
1940
1925
  VALUE obj = args[0];
@@ -1970,7 +1955,7 @@ SWIG_From_unsigned_SS_long (unsigned long value)
1970
1955
  }
1971
1956
 
1972
1957
 
1973
- /*@SWIG:/usr/local/Cellar/swig/2.0.7/share/swig/2.0.7/ruby/rubyprimtypes.swg,19,%ruby_aux_method@*/
1958
+ /*@SWIG:/usr/share/swig2.0/ruby/rubyprimtypes.swg,19,%ruby_aux_method@*/
1974
1959
  SWIGINTERN VALUE SWIG_AUX_NUM2LONG(VALUE *args)
1975
1960
  {
1976
1961
  VALUE obj = args[0];
@@ -2058,13 +2043,13 @@ SWIG_AsVal_char (VALUE obj, char *val)
2058
2043
  }
2059
2044
 
2060
2045
 
2061
- /*@SWIG:/usr/local/Cellar/swig/2.0.7/share/swig/2.0.7/ruby/rubyprimtypes.swg,19,%ruby_aux_method@*/
2046
+ /*@SWIG:/usr/share/swig2.0/ruby/rubyprimtypes.swg,19,%ruby_aux_method@*/
2062
2047
  SWIGINTERN VALUE SWIG_AUX_NUM2DBL(VALUE *args)
2063
2048
  {
2064
2049
  VALUE obj = args[0];
2065
2050
  VALUE type = TYPE(obj);
2066
2051
  double *res = (double *)(args[1]);
2067
- *res = NUM2DBL(obj);
2052
+ *res = NUM2DBL(obj); (void)type;
2068
2053
  return obj;
2069
2054
  }
2070
2055
  /*@SWIG@*/
@@ -3694,50 +3679,6 @@ fail:
3694
3679
  }
3695
3680
 
3696
3681
 
3697
- SWIGINTERN VALUE
3698
- _wrap_SwishFuzzy(int argc, VALUE *argv, VALUE self) {
3699
- SW_HANDLE arg1 = (SW_HANDLE) 0 ;
3700
- char *arg2 = (char *) 0 ;
3701
- char *arg3 = (char *) 0 ;
3702
- int res1 ;
3703
- int res2 ;
3704
- char *buf2 = 0 ;
3705
- int alloc2 = 0 ;
3706
- int res3 ;
3707
- char *buf3 = 0 ;
3708
- int alloc3 = 0 ;
3709
- SW_FUZZYWORD result;
3710
- VALUE vresult = Qnil;
3711
-
3712
- if ((argc < 3) || (argc > 3)) {
3713
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
3714
- }
3715
- res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
3716
- if (!SWIG_IsOK(res1)) {
3717
- SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "SW_HANDLE","SwishFuzzy", 1, argv[0] ));
3718
- }
3719
- res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
3720
- if (!SWIG_IsOK(res2)) {
3721
- SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","SwishFuzzy", 2, argv[1] ));
3722
- }
3723
- arg2 = (char *)(buf2);
3724
- res3 = SWIG_AsCharPtrAndSize(argv[2], &buf3, NULL, &alloc3);
3725
- if (!SWIG_IsOK(res3)) {
3726
- SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "char *","SwishFuzzy", 3, argv[2] ));
3727
- }
3728
- arg3 = (char *)(buf3);
3729
- result = (SW_FUZZYWORD)SwishFuzzy(arg1,(char const *)arg2,arg3);
3730
- vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 | 0 );
3731
- if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
3732
- if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
3733
- return vresult;
3734
- fail:
3735
- if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
3736
- if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
3737
- return Qnil;
3738
- }
3739
-
3740
-
3741
3682
  SWIGINTERN VALUE
3742
3683
  _wrap_SwishFuzzyWordList(int argc, VALUE *argv, VALUE self) {
3743
3684
  SW_FUZZYWORD arg1 = (SW_FUZZYWORD) 0 ;
@@ -4484,18 +4425,18 @@ static swig_cast_info *swig_cast_initial[] = {
4484
4425
 
4485
4426
  /* -----------------------------------------------------------------------------
4486
4427
  * Type initialization:
4487
- * This problem is tough by the requirement that no dynamic
4488
- * memory is used. Also, since swig_type_info structures store pointers to
4428
+ * This problem is tough by the requirement that no dynamic
4429
+ * memory is used. Also, since swig_type_info structures store pointers to
4489
4430
  * swig_cast_info structures and swig_cast_info structures store pointers back
4490
- * to swig_type_info structures, we need some lookup code at initialization.
4491
- * The idea is that swig generates all the structures that are needed.
4492
- * The runtime then collects these partially filled structures.
4493
- * The SWIG_InitializeModule function takes these initial arrays out of
4431
+ * to swig_type_info structures, we need some lookup code at initialization.
4432
+ * The idea is that swig generates all the structures that are needed.
4433
+ * The runtime then collects these partially filled structures.
4434
+ * The SWIG_InitializeModule function takes these initial arrays out of
4494
4435
  * swig_module, and does all the lookup, filling in the swig_module.types
4495
4436
  * array with the correct data and linking the correct swig_cast_info
4496
4437
  * structures together.
4497
4438
  *
4498
- * The generated swig_type_info structures are assigned staticly to an initial
4439
+ * The generated swig_type_info structures are assigned staticly to an initial
4499
4440
  * array. We just loop through that array, and handle each type individually.
4500
4441
  * First we lookup if this type has been already loaded, and if so, use the
4501
4442
  * loaded structure instead of the generated one. Then we have to fill in the
@@ -4505,17 +4446,17 @@ static swig_cast_info *swig_cast_initial[] = {
4505
4446
  * a column is one of the swig_cast_info structures for that type.
4506
4447
  * The cast_initial array is actually an array of arrays, because each row has
4507
4448
  * a variable number of columns. So to actually build the cast linked list,
4508
- * we find the array of casts associated with the type, and loop through it
4449
+ * we find the array of casts associated with the type, and loop through it
4509
4450
  * adding the casts to the list. The one last trick we need to do is making
4510
4451
  * sure the type pointer in the swig_cast_info struct is correct.
4511
4452
  *
4512
- * First off, we lookup the cast->type name to see if it is already loaded.
4453
+ * First off, we lookup the cast->type name to see if it is already loaded.
4513
4454
  * There are three cases to handle:
4514
4455
  * 1) If the cast->type has already been loaded AND the type we are adding
4515
4456
  * casting info to has not been loaded (it is in this module), THEN we
4516
4457
  * replace the cast->type pointer with the type pointer that has already
4517
4458
  * been loaded.
4518
- * 2) If BOTH types (the one we are adding casting info to, and the
4459
+ * 2) If BOTH types (the one we are adding casting info to, and the
4519
4460
  * cast->type) are loaded, THEN the cast info has already been loaded by
4520
4461
  * the previous module so we just ignore it.
4521
4462
  * 3) Finally, if cast->type has not already been loaded, then we add that
@@ -4541,8 +4482,6 @@ SWIG_InitializeModule(void *clientdata) {
4541
4482
  swig_module_info *module_head, *iter;
4542
4483
  int found, init;
4543
4484
 
4544
- clientdata = clientdata;
4545
-
4546
4485
  /* check to see if the circular list has been setup, if not, set it up */
4547
4486
  if (swig_module.next==0) {
4548
4487
  /* Initialize the swig_module */
@@ -4580,7 +4519,7 @@ SWIG_InitializeModule(void *clientdata) {
4580
4519
  module_head->next = &swig_module;
4581
4520
  }
4582
4521
 
4583
- /* When multiple interpeters are used, a module could have already been initialized in
4522
+ /* When multiple interpreters are used, a module could have already been initialized in
4584
4523
  a different interpreter, but not yet have a pointer in this interpreter.
4585
4524
  In this case, we do not want to continue adding types... everything should be
4586
4525
  set up already */
@@ -4594,7 +4533,7 @@ SWIG_InitializeModule(void *clientdata) {
4594
4533
  swig_type_info *type = 0;
4595
4534
  swig_type_info *ret;
4596
4535
  swig_cast_info *cast;
4597
-
4536
+
4598
4537
  #ifdef SWIGRUNTIME_DEBUG
4599
4538
  printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
4600
4539
  #endif
@@ -4621,7 +4560,7 @@ SWIG_InitializeModule(void *clientdata) {
4621
4560
  /* Insert casting types */
4622
4561
  cast = swig_module.cast_initial[i];
4623
4562
  while (cast->type) {
4624
-
4563
+
4625
4564
  /* Don't need to add information already in the list */
4626
4565
  ret = 0;
4627
4566
  #ifdef SWIGRUNTIME_DEBUG
@@ -4831,7 +4770,6 @@ SWIGEXPORT void Init_swishe_base(void) {
4831
4770
  rb_define_module_function(mSwishe_base, "SwishWordsByLetter", _wrap_SwishWordsByLetter, -1);
4832
4771
  rb_define_module_function(mSwishe_base, "SwishStemWord", _wrap_SwishStemWord, -1);
4833
4772
  rb_define_module_function(mSwishe_base, "SwishFuzzyWord", _wrap_SwishFuzzyWord, -1);
4834
- rb_define_module_function(mSwishe_base, "SwishFuzzy", _wrap_SwishFuzzy, -1);
4835
4773
  rb_define_module_function(mSwishe_base, "SwishFuzzyWordList", _wrap_SwishFuzzyWordList, -1);
4836
4774
  rb_define_module_function(mSwishe_base, "SwishFuzzyWordCount", _wrap_SwishFuzzyWordCount, -1);
4837
4775
  rb_define_module_function(mSwishe_base, "SwishFuzzyWordError", _wrap_SwishFuzzyWordError, -1);
data/setup.rb CHANGED
@@ -256,7 +256,12 @@ class ConfigTable_class
256
256
 
257
257
  end
258
258
 
259
- c = ::Config::CONFIG
259
+
260
+ c = if defined?(RbConfig) then
261
+ RbConfig::CONFIG
262
+ else
263
+ ::Config::CONFIG
264
+ end
260
265
 
261
266
  rubypath = c['bindir'] + '/' + c['ruby_install_name']
262
267
 
@@ -355,7 +360,6 @@ class ConfigTable_class # open again
355
360
  'site-ruby-common' => 'siteruby', # For backward compatibility
356
361
  'site-ruby' => 'siterubyver', # For backward compatibility
357
362
  'bin-dir' => 'bindir',
358
- 'bin-dir' => 'bindir',
359
363
  'rb-dir' => 'rbdir',
360
364
  'so-dir' => 'sodir',
361
365
  'data-dir' => 'datadir',
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: swishe
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.2
4
+ version: 0.4.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Patrick Gundlach
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-12-23 00:00:00.000000000 Z
12
+ date: 2016-11-05 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: Wrapper around libswish, a text indexing system.
15
15
  email:
@@ -21,45 +21,43 @@ extra_rdoc_files:
21
21
  - README.md
22
22
  - MIT-LICENSE
23
23
  files:
24
- - lib/swishe.rb
24
+ - MIT-LICENSE
25
+ - README.md
26
+ - ext/extconf.rb
25
27
  - ext/swish-e.i
26
28
  - ext/swishe_base.c
27
- - ext/extconf.rb
29
+ - lib/swishe.rb
28
30
  - setup.rb
29
31
  - test/tc_swishe.rb
30
32
  - test/unittest.rb
31
- - README.md
32
- - MIT-LICENSE
33
33
  homepage: https://github.com/nspring/swish-e-gem
34
34
  licenses:
35
35
  - MIT
36
36
  metadata: {}
37
37
  post_install_message:
38
38
  rdoc_options:
39
- - --main
39
+ - "--main"
40
40
  - README.md
41
- - --title
41
+ - "--title"
42
42
  - swish-e ruby bindings documentation
43
43
  require_paths:
44
44
  - lib
45
- - ext
46
45
  required_ruby_version: !ruby/object:Gem::Requirement
47
46
  requirements:
48
- - - '>='
47
+ - - ">="
49
48
  - !ruby/object:Gem::Version
50
49
  version: '0'
51
50
  required_rubygems_version: !ruby/object:Gem::Requirement
52
51
  requirements:
53
- - - '>='
52
+ - - ">="
54
53
  - !ruby/object:Gem::Version
55
54
  version: '0'
56
55
  requirements: []
57
56
  rubyforge_project:
58
- rubygems_version: 2.0.14
57
+ rubygems_version: 2.5.1
59
58
  signing_key:
60
59
  specification_version: 4
61
60
  summary: Ruby bindings for swish-e.
62
61
  test_files:
63
- - test/tc_swishe.rb
64
62
  - test/unittest.rb
65
- has_rdoc:
63
+ - test/tc_swishe.rb