blurrily 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ed16411964b25da880e1352dbf23259c6a3cad15
4
- data.tar.gz: 5040661414e99211116945e2db5c75ecbe23c632
3
+ metadata.gz: 6d589b491f1c3cb4e02d4d01c537481214849b79
4
+ data.tar.gz: 6878872b390a92ce118ec9d2f882628e0c79c460
5
5
  SHA512:
6
- metadata.gz: 8dcba4b00f325431bed101bdb16dc89a21e0d695537ba4222e05f20a5209c350077a02af18ce0dbb5f05ab5def8a00f4978021550d43e9880abcaabbca9d4fde
7
- data.tar.gz: bca6a4306b94271a04c3ac92e3520603fa557f5d3e842bf485e02e82a3b4786d4eb812f1fecfa1371ce97737a73af336a5fff4b4ce6f257f26136dd1b3e7ab78
6
+ metadata.gz: f1cd22deb6a6e87899e4a99b395da4e2f661a9f233717e4b451f5744897d5cfec4c82b5bbae28b017622894439af70dddf792fcda77aad0a7b02ffbadadcae98
7
+ data.tar.gz: 3725e7de9b874849c8fb27ba6dad46c2f0a2098302aaa8c138cd5227d83e9cff58dee590be944540060df6636a9e43f2ceaef4e3736f42953103da111236fe83
data/README.md CHANGED
@@ -8,7 +8,7 @@
8
8
 
9
9
  > Show me photos of **Marakech** !
10
10
  >
11
- > Here aresome photos of **Marrakesh**, Morroco.
11
+ > Here are some photos of **Marrakesh**, Morroco.
12
12
  > Did you mean **Martanesh**, Albania, **Marakkanam**, India, or **Marasheshty**, Romania?
13
13
 
14
14
  Blurrily finds misspelled, prefix, or partial needles in a haystack of
@@ -6,7 +6,10 @@
6
6
 
7
7
  */
8
8
 
9
- #define PACKED_STRUCT __attribute__ ((__packed__))
9
+ #ifndef __BLURRILY_H__
10
+ #define __BLURRILY_H__ 1
11
+
12
+ #define BR_PACKED_STRUCT __attribute__ ((__packed__))
10
13
  #define UNUSED(_IDENT) _IDENT __attribute__ ((unused))
11
14
 
12
15
  #ifdef DEBUG
@@ -14,3 +17,5 @@
14
17
  #else
15
18
  #define LOG(...)
16
19
  #endif
20
+
21
+ #endif
@@ -33,7 +33,7 @@
33
33
  /******************************************************************************/
34
34
 
35
35
  /* one trigram entry -- client reference and sorting weight */
36
- struct PACKED_STRUCT trigram_entry_t
36
+ struct BR_PACKED_STRUCT trigram_entry_t
37
37
  {
38
38
  uint32_t reference;
39
39
  uint32_t weight;
@@ -44,7 +44,7 @@ typedef struct trigram_entry_t trigram_entry_t;
44
44
  /* collection of entries for a given trigram */
45
45
  /* <entries> points to an array of <buckets> entries */
46
46
  /* of which <used> are filled */
47
- struct PACKED_STRUCT trigram_entries_t
47
+ struct BR_PACKED_STRUCT trigram_entries_t
48
48
  {
49
49
  uint32_t buckets;
50
50
  uint32_t used;
@@ -59,7 +59,7 @@ typedef struct trigram_entries_t trigram_entries_t;
59
59
 
60
60
  /* hash map of all possible trigrams to collection of entries */
61
61
  /* there are 28^3 = 19,683 possible trigrams */
62
- struct PACKED_STRUCT trigram_map_t
62
+ struct BR_PACKED_STRUCT trigram_map_t
63
63
  {
64
64
  char magic[6]; /* the string "trigra" */
65
65
  uint8_t big_endian;
@@ -5,6 +5,9 @@
5
5
  Trigram map creation, persistence, and qurying.
6
6
 
7
7
  */
8
+ #ifndef __STORAGE_H__
9
+ #define __STORAGE_H__
10
+
8
11
  #include <inttypes.h>
9
12
  #include "tokeniser.h"
10
13
  #include "blurrily.h"
@@ -12,7 +15,7 @@
12
15
  struct trigram_map_t;
13
16
  typedef struct trigram_map_t* trigram_map;
14
17
 
15
- struct PACKED_STRUCT trigram_match_t {
18
+ struct BR_PACKED_STRUCT trigram_match_t {
16
19
  uint32_t reference;
17
20
  uint32_t matches;
18
21
  uint32_t weight;
@@ -113,3 +116,4 @@ int blurrily_storage_find(trigram_map haystack, const char* needle, uint16_t lim
113
116
  */
114
117
  int blurrily_storage_stats(trigram_map haystack, trigram_stat_t* stats);
115
118
 
119
+ #endif
@@ -14,6 +14,9 @@
14
14
  Each trigram is represented by a 16-bit integer.
15
15
 
16
16
  */
17
+ #ifndef __TOKENISER_H__
18
+ #define __TOKENISER_H__
19
+
17
20
  #include <inttypes.h>
18
21
 
19
22
  #define TRIGRAM_BASE 28
@@ -39,3 +42,5 @@ int blurrily_tokeniser_parse_string(const char* input, trigram_t* output);
39
42
  Returns positive on success, negative on failure.
40
43
  */
41
44
  int blurrily_tokeniser_trigram(trigram_t input, char* output);
45
+
46
+ #endif
@@ -1,3 +1,3 @@
1
1
  module Blurrily
2
- VERSION = "1.0.1"
2
+ VERSION = "1.0.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blurrily
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Julien Letessier
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2014-11-21 00:00:00.000000000 Z
13
+ date: 2015-01-05 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activesupport
@@ -270,7 +270,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
270
270
  version: '0'
271
271
  requirements: []
272
272
  rubyforge_project:
273
- rubygems_version: 2.2.2
273
+ rubygems_version: 2.4.5
274
274
  signing_key:
275
275
  specification_version: 4
276
276
  summary: Native fuzzy string search