melisa 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (166) hide show
  1. checksums.yaml +7 -0
  2. data/README.md +53 -4
  3. data/ext/extconf.rb +33 -0
  4. data/ext/marisa-0.2.4/AUTHORS +1 -0
  5. data/ext/marisa-0.2.4/COPYING +32 -0
  6. data/ext/marisa-0.2.4/ChangeLog +0 -0
  7. data/ext/marisa-0.2.4/INSTALL +237 -0
  8. data/ext/marisa-0.2.4/Makefile.am +24 -0
  9. data/ext/marisa-0.2.4/Makefile.in +803 -0
  10. data/ext/marisa-0.2.4/NEWS +0 -0
  11. data/ext/marisa-0.2.4/README +63 -0
  12. data/ext/marisa-0.2.4/aclocal.m4 +976 -0
  13. data/ext/marisa-0.2.4/bindings/Makefile +16 -0
  14. data/ext/{marisa → marisa-0.2.4}/bindings/marisa-swig.cxx +0 -0
  15. data/ext/{marisa → marisa-0.2.4}/bindings/marisa-swig.h +0 -0
  16. data/ext/marisa-0.2.4/bindings/marisa-swig.i +28 -0
  17. data/ext/marisa-0.2.4/bindings/perl/Makefile.PL +7 -0
  18. data/ext/{marisa → marisa-0.2.4}/bindings/perl/marisa-swig.cxx +0 -0
  19. data/ext/{marisa → marisa-0.2.4}/bindings/perl/marisa-swig.h +0 -0
  20. data/ext/{marisa → marisa-0.2.4}/bindings/perl/marisa-swig_wrap.cxx +0 -0
  21. data/ext/marisa-0.2.4/bindings/perl/marisa.pm +297 -0
  22. data/ext/marisa-0.2.4/bindings/perl/sample.dic +0 -0
  23. data/ext/marisa-0.2.4/bindings/perl/sample.pl +62 -0
  24. data/ext/{marisa → marisa-0.2.4}/bindings/python/marisa-swig.cxx +0 -0
  25. data/ext/{marisa → marisa-0.2.4}/bindings/python/marisa-swig.h +0 -0
  26. data/ext/{marisa → marisa-0.2.4}/bindings/python/marisa-swig_wrap.cxx +0 -0
  27. data/ext/marisa-0.2.4/bindings/python/marisa.py +206 -0
  28. data/ext/marisa-0.2.4/bindings/python/sample.dic +0 -0
  29. data/ext/marisa-0.2.4/bindings/python/sample.py +57 -0
  30. data/ext/marisa-0.2.4/bindings/python/setup.py +9 -0
  31. data/ext/marisa-0.2.4/config.guess +1530 -0
  32. data/ext/marisa-0.2.4/config.sub +1773 -0
  33. data/ext/marisa-0.2.4/configure +17636 -0
  34. data/ext/marisa-0.2.4/configure.ac +172 -0
  35. data/ext/marisa-0.2.4/depcomp +688 -0
  36. data/ext/marisa-0.2.4/docs/readme.en.html +740 -0
  37. data/ext/marisa-0.2.4/docs/readme.ja.html +750 -0
  38. data/ext/marisa-0.2.4/docs/style.css +245 -0
  39. data/ext/marisa-0.2.4/install-sh +520 -0
  40. data/ext/marisa-0.2.4/lib/Makefile.am +57 -0
  41. data/ext/marisa-0.2.4/lib/Makefile.in +701 -0
  42. data/ext/{marisa → marisa-0.2.4}/lib/marisa.h +0 -0
  43. data/ext/{marisa → marisa-0.2.4}/lib/marisa/agent.cc +2 -2
  44. data/ext/{marisa → marisa-0.2.4}/lib/marisa/agent.h +2 -2
  45. data/ext/{marisa → marisa-0.2.4}/lib/marisa/base.h +3 -3
  46. data/ext/{marisa → marisa-0.2.4}/lib/marisa/exception.h +1 -1
  47. data/ext/{marisa → marisa-0.2.4}/lib/marisa/grimoire/algorithm.h +1 -1
  48. data/ext/{marisa → marisa-0.2.4}/lib/marisa/grimoire/algorithm/sort.h +1 -1
  49. data/ext/{marisa → marisa-0.2.4}/lib/marisa/grimoire/intrin.h +1 -1
  50. data/ext/{marisa → marisa-0.2.4}/lib/marisa/grimoire/io.h +3 -3
  51. data/ext/{marisa → marisa-0.2.4}/lib/marisa/grimoire/io/mapper.cc +1 -1
  52. data/ext/{marisa → marisa-0.2.4}/lib/marisa/grimoire/io/mapper.h +1 -1
  53. data/ext/{marisa → marisa-0.2.4}/lib/marisa/grimoire/io/reader.cc +1 -1
  54. data/ext/{marisa → marisa-0.2.4}/lib/marisa/grimoire/io/reader.h +1 -1
  55. data/ext/{marisa → marisa-0.2.4}/lib/marisa/grimoire/io/writer.cc +1 -1
  56. data/ext/{marisa → marisa-0.2.4}/lib/marisa/grimoire/io/writer.h +1 -1
  57. data/ext/{marisa → marisa-0.2.4}/lib/marisa/grimoire/trie.h +2 -2
  58. data/ext/{marisa → marisa-0.2.4}/lib/marisa/grimoire/trie/cache.h +1 -1
  59. data/ext/{marisa → marisa-0.2.4}/lib/marisa/grimoire/trie/config.h +1 -1
  60. data/ext/{marisa → marisa-0.2.4}/lib/marisa/grimoire/trie/entry.h +1 -1
  61. data/ext/{marisa → marisa-0.2.4}/lib/marisa/grimoire/trie/header.h +1 -1
  62. data/ext/{marisa → marisa-0.2.4}/lib/marisa/grimoire/trie/history.h +1 -1
  63. data/ext/{marisa → marisa-0.2.4}/lib/marisa/grimoire/trie/key.h +1 -1
  64. data/ext/{marisa → marisa-0.2.4}/lib/marisa/grimoire/trie/louds-trie.cc +5 -5
  65. data/ext/{marisa → marisa-0.2.4}/lib/marisa/grimoire/trie/louds-trie.h +7 -7
  66. data/ext/{marisa → marisa-0.2.4}/lib/marisa/grimoire/trie/range.h +1 -1
  67. data/ext/{marisa → marisa-0.2.4}/lib/marisa/grimoire/trie/state.h +2 -2
  68. data/ext/{marisa → marisa-0.2.4}/lib/marisa/grimoire/trie/tail.cc +3 -3
  69. data/ext/{marisa → marisa-0.2.4}/lib/marisa/grimoire/trie/tail.h +3 -3
  70. data/ext/{marisa → marisa-0.2.4}/lib/marisa/grimoire/vector.h +3 -3
  71. data/ext/{marisa → marisa-0.2.4}/lib/marisa/grimoire/vector/bit-vector.cc +2 -2
  72. data/ext/{marisa → marisa-0.2.4}/lib/marisa/grimoire/vector/bit-vector.h +2 -2
  73. data/ext/{marisa → marisa-0.2.4}/lib/marisa/grimoire/vector/flat-vector.h +1 -1
  74. data/ext/{marisa → marisa-0.2.4}/lib/marisa/grimoire/vector/pop-count.h +1 -1
  75. data/ext/{marisa → marisa-0.2.4}/lib/marisa/grimoire/vector/rank-index.h +1 -1
  76. data/ext/{marisa → marisa-0.2.4}/lib/marisa/grimoire/vector/vector.h +1 -1
  77. data/ext/{marisa → marisa-0.2.4}/lib/marisa/iostream.h +0 -0
  78. data/ext/{marisa → marisa-0.2.4}/lib/marisa/key.h +1 -1
  79. data/ext/{marisa → marisa-0.2.4}/lib/marisa/keyset.cc +1 -1
  80. data/ext/{marisa → marisa-0.2.4}/lib/marisa/keyset.h +1 -1
  81. data/ext/{marisa → marisa-0.2.4}/lib/marisa/query.h +1 -1
  82. data/ext/{marisa → marisa-0.2.4}/lib/marisa/scoped-array.h +1 -1
  83. data/ext/{marisa → marisa-0.2.4}/lib/marisa/scoped-ptr.h +1 -1
  84. data/ext/{marisa → marisa-0.2.4}/lib/marisa/stdio.h +0 -0
  85. data/ext/{marisa → marisa-0.2.4}/lib/marisa/trie.cc +4 -4
  86. data/ext/{marisa → marisa-0.2.4}/lib/marisa/trie.h +2 -2
  87. data/ext/marisa-0.2.4/ltmain.sh +9661 -0
  88. data/ext/marisa-0.2.4/m4/libtool.m4 +8001 -0
  89. data/ext/marisa-0.2.4/m4/ltoptions.m4 +384 -0
  90. data/ext/marisa-0.2.4/m4/ltsugar.m4 +123 -0
  91. data/ext/marisa-0.2.4/m4/ltversion.m4 +23 -0
  92. data/ext/marisa-0.2.4/m4/lt~obsolete.m4 +98 -0
  93. data/ext/marisa-0.2.4/marisa.pc.in +11 -0
  94. data/ext/marisa-0.2.4/missing +331 -0
  95. data/ext/marisa-0.2.4/mkmf.log +288 -0
  96. data/ext/marisa-0.2.4/pkg/bin/marisa-benchmark +0 -0
  97. data/ext/marisa-0.2.4/pkg/bin/marisa-build +0 -0
  98. data/ext/marisa-0.2.4/pkg/bin/marisa-common-prefix-search +0 -0
  99. data/ext/marisa-0.2.4/pkg/bin/marisa-dump +0 -0
  100. data/ext/marisa-0.2.4/pkg/bin/marisa-lookup +0 -0
  101. data/ext/marisa-0.2.4/pkg/bin/marisa-predictive-search +0 -0
  102. data/ext/marisa-0.2.4/pkg/bin/marisa-reverse-lookup +0 -0
  103. data/ext/marisa-0.2.4/pkg/include/marisa.h +14 -0
  104. data/ext/marisa-0.2.4/pkg/include/marisa/agent.h +73 -0
  105. data/ext/marisa-0.2.4/pkg/include/marisa/base.h +193 -0
  106. data/ext/marisa-0.2.4/pkg/include/marisa/exception.h +82 -0
  107. data/ext/marisa-0.2.4/pkg/include/marisa/iostream.h +18 -0
  108. data/ext/marisa-0.2.4/pkg/include/marisa/key.h +85 -0
  109. data/ext/marisa-0.2.4/pkg/include/marisa/keyset.h +80 -0
  110. data/ext/marisa-0.2.4/pkg/include/marisa/query.h +71 -0
  111. data/ext/marisa-0.2.4/pkg/include/marisa/scoped-array.h +48 -0
  112. data/ext/marisa-0.2.4/pkg/include/marisa/scoped-ptr.h +52 -0
  113. data/ext/marisa-0.2.4/pkg/include/marisa/stdio.h +15 -0
  114. data/ext/marisa-0.2.4/pkg/include/marisa/trie.h +64 -0
  115. data/ext/marisa-0.2.4/pkg/lib/libmarisa.0.dylib +0 -0
  116. data/ext/marisa-0.2.4/pkg/lib/libmarisa.a +0 -0
  117. data/ext/marisa-0.2.4/pkg/lib/libmarisa.dylib +0 -0
  118. data/ext/marisa-0.2.4/pkg/lib/libmarisa.la +41 -0
  119. data/ext/marisa-0.2.4/pkg/lib/pkgconfig/marisa.pc +11 -0
  120. data/ext/marisa-0.2.4/tests/Makefile.am +27 -0
  121. data/ext/marisa-0.2.4/tests/Makefile.in +624 -0
  122. data/ext/{marisa → marisa-0.2.4}/tests/base-test.cc +0 -0
  123. data/ext/{marisa → marisa-0.2.4}/tests/io-test.cc +0 -0
  124. data/ext/{marisa → marisa-0.2.4}/tests/marisa-assert.h +0 -0
  125. data/ext/{marisa → marisa-0.2.4}/tests/marisa-test.cc +0 -0
  126. data/ext/{marisa → marisa-0.2.4}/tests/trie-test.cc +0 -0
  127. data/ext/{marisa → marisa-0.2.4}/tests/vector-test.cc +0 -0
  128. data/ext/marisa-0.2.4/tools/Makefile.am +39 -0
  129. data/ext/marisa-0.2.4/tools/Makefile.in +616 -0
  130. data/ext/{marisa → marisa-0.2.4}/tools/cmdopt.cc +0 -0
  131. data/ext/{marisa → marisa-0.2.4}/tools/cmdopt.h +0 -0
  132. data/ext/{marisa → marisa-0.2.4}/tools/marisa-benchmark.cc +0 -0
  133. data/ext/{marisa → marisa-0.2.4}/tools/marisa-build.cc +0 -0
  134. data/ext/{marisa → marisa-0.2.4}/tools/marisa-common-prefix-search.cc +0 -0
  135. data/ext/{marisa → marisa-0.2.4}/tools/marisa-dump.cc +0 -0
  136. data/ext/{marisa → marisa-0.2.4}/tools/marisa-lookup.cc +0 -0
  137. data/ext/{marisa → marisa-0.2.4}/tools/marisa-predictive-search.cc +0 -0
  138. data/ext/{marisa → marisa-0.2.4}/tools/marisa-reverse-lookup.cc +0 -0
  139. data/ext/marisa-0.2.4/vs2008/base-test/base-test.vcproj +200 -0
  140. data/ext/marisa-0.2.4/vs2008/io-test/io-test.vcproj +199 -0
  141. data/ext/marisa-0.2.4/vs2008/libmarisa/libmarisa.vcproj +347 -0
  142. data/ext/marisa-0.2.4/vs2008/marisa-benchmark/marisa-benchmark.vcproj +203 -0
  143. data/ext/marisa-0.2.4/vs2008/marisa-build/marisa-build.vcproj +203 -0
  144. data/ext/marisa-0.2.4/vs2008/marisa-common-prefix-search/marisa-common-prefix-search.vcproj +203 -0
  145. data/ext/marisa-0.2.4/vs2008/marisa-dump/marisa-dump.vcproj +203 -0
  146. data/ext/marisa-0.2.4/vs2008/marisa-lookup/marisa-lookup.vcproj +203 -0
  147. data/ext/marisa-0.2.4/vs2008/marisa-predictive-search/marisa-predictive-search.vcproj +203 -0
  148. data/ext/marisa-0.2.4/vs2008/marisa-reverse-lookup/marisa-reverse-lookup.vcproj +203 -0
  149. data/ext/marisa-0.2.4/vs2008/marisa-test/marisa-test.vcproj +199 -0
  150. data/ext/marisa-0.2.4/vs2008/trie-test/trie-test.vcproj +199 -0
  151. data/ext/marisa-0.2.4/vs2008/vector-test/vector-test.vcproj +199 -0
  152. data/ext/marisa-0.2.4/vs2008/vs2008.sln +123 -0
  153. data/ext/marisa-0.2.4/vs2008/vs2008.suo +0 -0
  154. data/ext/{marisa/bindings/ruby/marisa-swig.cxx → marisa-swig.cxx} +0 -0
  155. data/ext/{marisa/bindings/ruby/marisa-swig.h → marisa-swig.h} +0 -0
  156. data/ext/{marisa/bindings/ruby/marisa-swig_wrap.cxx → marisa-swig_wrap.cxx} +0 -0
  157. data/lib/melisa/bytes_trie.rb +5 -0
  158. data/lib/melisa/trie.rb +2 -0
  159. data/lib/melisa/version.rb +1 -1
  160. data/melisa.gemspec +7 -9
  161. data/spec/bytes_trie_spec.rb +6 -1
  162. data/spec/int_trie_spec.rb +5 -0
  163. data/spec/search_spec.rb +6 -7
  164. data/spec/trie_spec.rb +4 -4
  165. metadata +178 -121
  166. data/ext/marisa/bindings/ruby/extconf.rb +0 -5
@@ -0,0 +1,199 @@
1
+ <?xml version="1.0" encoding="shift_jis"?>
2
+ <VisualStudioProject
3
+ ProjectType="Visual C++"
4
+ Version="9.00"
5
+ Name="vector-test"
6
+ ProjectGUID="{B20AE738-2F4F-4E96-A673-F5A02591D50E}"
7
+ RootNamespace="vectortest"
8
+ Keyword="Win32Proj"
9
+ TargetFrameworkVersion="196613"
10
+ >
11
+ <Platforms>
12
+ <Platform
13
+ Name="Win32"
14
+ />
15
+ </Platforms>
16
+ <ToolFiles>
17
+ </ToolFiles>
18
+ <Configurations>
19
+ <Configuration
20
+ Name="Debug|Win32"
21
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
22
+ IntermediateDirectory="$(ConfigurationName)"
23
+ ConfigurationType="1"
24
+ CharacterSet="1"
25
+ >
26
+ <Tool
27
+ Name="VCPreBuildEventTool"
28
+ />
29
+ <Tool
30
+ Name="VCCustomBuildTool"
31
+ />
32
+ <Tool
33
+ Name="VCXMLDataGeneratorTool"
34
+ />
35
+ <Tool
36
+ Name="VCWebServiceProxyGeneratorTool"
37
+ />
38
+ <Tool
39
+ Name="VCMIDLTool"
40
+ />
41
+ <Tool
42
+ Name="VCCLCompilerTool"
43
+ Optimization="0"
44
+ AdditionalIncludeDirectories="../../lib"
45
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
46
+ MinimalRebuild="true"
47
+ BasicRuntimeChecks="3"
48
+ RuntimeLibrary="3"
49
+ UsePrecompiledHeader="0"
50
+ WarningLevel="4"
51
+ DebugInformationFormat="4"
52
+ />
53
+ <Tool
54
+ Name="VCManagedResourceCompilerTool"
55
+ />
56
+ <Tool
57
+ Name="VCResourceCompilerTool"
58
+ />
59
+ <Tool
60
+ Name="VCPreLinkEventTool"
61
+ />
62
+ <Tool
63
+ Name="VCLinkerTool"
64
+ LinkIncremental="2"
65
+ GenerateDebugInformation="true"
66
+ SubSystem="1"
67
+ TargetMachine="1"
68
+ />
69
+ <Tool
70
+ Name="VCALinkTool"
71
+ />
72
+ <Tool
73
+ Name="VCManifestTool"
74
+ />
75
+ <Tool
76
+ Name="VCXDCMakeTool"
77
+ />
78
+ <Tool
79
+ Name="VCBscMakeTool"
80
+ />
81
+ <Tool
82
+ Name="VCFxCopTool"
83
+ />
84
+ <Tool
85
+ Name="VCAppVerifierTool"
86
+ />
87
+ <Tool
88
+ Name="VCPostBuildEventTool"
89
+ />
90
+ </Configuration>
91
+ <Configuration
92
+ Name="Release|Win32"
93
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
94
+ IntermediateDirectory="$(ConfigurationName)"
95
+ ConfigurationType="1"
96
+ CharacterSet="1"
97
+ WholeProgramOptimization="1"
98
+ >
99
+ <Tool
100
+ Name="VCPreBuildEventTool"
101
+ />
102
+ <Tool
103
+ Name="VCCustomBuildTool"
104
+ />
105
+ <Tool
106
+ Name="VCXMLDataGeneratorTool"
107
+ />
108
+ <Tool
109
+ Name="VCWebServiceProxyGeneratorTool"
110
+ />
111
+ <Tool
112
+ Name="VCMIDLTool"
113
+ />
114
+ <Tool
115
+ Name="VCCLCompilerTool"
116
+ Optimization="2"
117
+ EnableIntrinsicFunctions="true"
118
+ AdditionalIncludeDirectories="../../lib"
119
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
120
+ RuntimeLibrary="2"
121
+ EnableFunctionLevelLinking="true"
122
+ UsePrecompiledHeader="0"
123
+ WarningLevel="4"
124
+ DebugInformationFormat="3"
125
+ />
126
+ <Tool
127
+ Name="VCManagedResourceCompilerTool"
128
+ />
129
+ <Tool
130
+ Name="VCResourceCompilerTool"
131
+ />
132
+ <Tool
133
+ Name="VCPreLinkEventTool"
134
+ />
135
+ <Tool
136
+ Name="VCLinkerTool"
137
+ LinkIncremental="1"
138
+ GenerateDebugInformation="true"
139
+ SubSystem="1"
140
+ OptimizeReferences="2"
141
+ EnableCOMDATFolding="2"
142
+ TargetMachine="1"
143
+ />
144
+ <Tool
145
+ Name="VCALinkTool"
146
+ />
147
+ <Tool
148
+ Name="VCManifestTool"
149
+ />
150
+ <Tool
151
+ Name="VCXDCMakeTool"
152
+ />
153
+ <Tool
154
+ Name="VCBscMakeTool"
155
+ />
156
+ <Tool
157
+ Name="VCFxCopTool"
158
+ />
159
+ <Tool
160
+ Name="VCAppVerifierTool"
161
+ />
162
+ <Tool
163
+ Name="VCPostBuildEventTool"
164
+ />
165
+ </Configuration>
166
+ </Configurations>
167
+ <References>
168
+ </References>
169
+ <Files>
170
+ <Filter
171
+ Name="Source Files"
172
+ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
173
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
174
+ >
175
+ <File
176
+ RelativePath="..\..\tests\vector-test.cc"
177
+ >
178
+ </File>
179
+ </Filter>
180
+ <Filter
181
+ Name="Header Files"
182
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
183
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
184
+ >
185
+ <File
186
+ RelativePath="..\..\tests\assert.h"
187
+ >
188
+ </File>
189
+ </Filter>
190
+ <Filter
191
+ Name="Resource Files"
192
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
193
+ UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
194
+ >
195
+ </Filter>
196
+ </Files>
197
+ <Globals>
198
+ </Globals>
199
+ </VisualStudioProject>
@@ -0,0 +1,123 @@
1
+ 
2
+ Microsoft Visual Studio Solution File, Format Version 10.00
3
+ # Visual Studio 2008
4
+ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "marisa-benchmark", "marisa-benchmark\marisa-benchmark.vcproj", "{85E7F33D-2053-47AD-AEA4-4DB8B754BCD7}"
5
+ ProjectSection(ProjectDependencies) = postProject
6
+ {3BE97421-D962-4330-815B-AC9B7B799F15} = {3BE97421-D962-4330-815B-AC9B7B799F15}
7
+ EndProjectSection
8
+ EndProject
9
+ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "marisa-build", "marisa-build\marisa-build.vcproj", "{104CFCC9-11DF-4894-894B-BFE5F5C13DCA}"
10
+ ProjectSection(ProjectDependencies) = postProject
11
+ {3BE97421-D962-4330-815B-AC9B7B799F15} = {3BE97421-D962-4330-815B-AC9B7B799F15}
12
+ EndProjectSection
13
+ EndProject
14
+ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "marisa-lookup", "marisa-lookup\marisa-lookup.vcproj", "{98C25734-1D4B-48A7-B8B2-D6559410FF3F}"
15
+ ProjectSection(ProjectDependencies) = postProject
16
+ {3BE97421-D962-4330-815B-AC9B7B799F15} = {3BE97421-D962-4330-815B-AC9B7B799F15}
17
+ EndProjectSection
18
+ EndProject
19
+ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "io-test", "io-test\io-test.vcproj", "{24807515-7B42-4E76-B630-E82BDA83845C}"
20
+ ProjectSection(ProjectDependencies) = postProject
21
+ {3BE97421-D962-4330-815B-AC9B7B799F15} = {3BE97421-D962-4330-815B-AC9B7B799F15}
22
+ EndProjectSection
23
+ EndProject
24
+ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "trie-test", "trie-test\trie-test.vcproj", "{F1876AD7-43C2-4D95-BB45-E1EAED974C75}"
25
+ ProjectSection(ProjectDependencies) = postProject
26
+ {3BE97421-D962-4330-815B-AC9B7B799F15} = {3BE97421-D962-4330-815B-AC9B7B799F15}
27
+ EndProjectSection
28
+ EndProject
29
+ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vector-test", "vector-test\vector-test.vcproj", "{B20AE738-2F4F-4E96-A673-F5A02591D50E}"
30
+ ProjectSection(ProjectDependencies) = postProject
31
+ {3BE97421-D962-4330-815B-AC9B7B799F15} = {3BE97421-D962-4330-815B-AC9B7B799F15}
32
+ EndProjectSection
33
+ EndProject
34
+ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "marisa-test", "marisa-test\marisa-test.vcproj", "{594A9352-4170-4F5D-AEB3-E6C96DA2E87F}"
35
+ ProjectSection(ProjectDependencies) = postProject
36
+ {3BE97421-D962-4330-815B-AC9B7B799F15} = {3BE97421-D962-4330-815B-AC9B7B799F15}
37
+ EndProjectSection
38
+ EndProject
39
+ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "base-test", "base-test\base-test.vcproj", "{27D9F340-49F7-4715-B77D-B44CE57B7CBD}"
40
+ ProjectSection(ProjectDependencies) = postProject
41
+ {3BE97421-D962-4330-815B-AC9B7B799F15} = {3BE97421-D962-4330-815B-AC9B7B799F15}
42
+ EndProjectSection
43
+ EndProject
44
+ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "marisa-reverse-lookup", "marisa-reverse-lookup\marisa-reverse-lookup.vcproj", "{EC73A2FE-5D85-45C3-A223-37737C823476}"
45
+ ProjectSection(ProjectDependencies) = postProject
46
+ {3BE97421-D962-4330-815B-AC9B7B799F15} = {3BE97421-D962-4330-815B-AC9B7B799F15}
47
+ EndProjectSection
48
+ EndProject
49
+ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "marisa-common-prefix-search", "marisa-common-prefix-search\marisa-common-prefix-search.vcproj", "{C4C7BA27-B713-47C0-92B1-FF70EAC9A373}"
50
+ ProjectSection(ProjectDependencies) = postProject
51
+ {3BE97421-D962-4330-815B-AC9B7B799F15} = {3BE97421-D962-4330-815B-AC9B7B799F15}
52
+ EndProjectSection
53
+ EndProject
54
+ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "marisa-predictive-search", "marisa-predictive-search\marisa-predictive-search.vcproj", "{B4B56EF0-681D-4B32-AD14-F855D67CB01B}"
55
+ ProjectSection(ProjectDependencies) = postProject
56
+ {3BE97421-D962-4330-815B-AC9B7B799F15} = {3BE97421-D962-4330-815B-AC9B7B799F15}
57
+ EndProjectSection
58
+ EndProject
59
+ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libmarisa", "libmarisa\libmarisa.vcproj", "{3BE97421-D962-4330-815B-AC9B7B799F15}"
60
+ EndProject
61
+ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "marisa-dump", "marisa-dump\marisa-dump.vcproj", "{2B7CDB51-C796-4CD2-82ED-F782C7952204}"
62
+ ProjectSection(ProjectDependencies) = postProject
63
+ {3BE97421-D962-4330-815B-AC9B7B799F15} = {3BE97421-D962-4330-815B-AC9B7B799F15}
64
+ EndProjectSection
65
+ EndProject
66
+ Global
67
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
68
+ Debug|Win32 = Debug|Win32
69
+ Release|Win32 = Release|Win32
70
+ EndGlobalSection
71
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
72
+ {85E7F33D-2053-47AD-AEA4-4DB8B754BCD7}.Debug|Win32.ActiveCfg = Debug|Win32
73
+ {85E7F33D-2053-47AD-AEA4-4DB8B754BCD7}.Debug|Win32.Build.0 = Debug|Win32
74
+ {85E7F33D-2053-47AD-AEA4-4DB8B754BCD7}.Release|Win32.ActiveCfg = Release|Win32
75
+ {85E7F33D-2053-47AD-AEA4-4DB8B754BCD7}.Release|Win32.Build.0 = Release|Win32
76
+ {104CFCC9-11DF-4894-894B-BFE5F5C13DCA}.Debug|Win32.ActiveCfg = Debug|Win32
77
+ {104CFCC9-11DF-4894-894B-BFE5F5C13DCA}.Debug|Win32.Build.0 = Debug|Win32
78
+ {104CFCC9-11DF-4894-894B-BFE5F5C13DCA}.Release|Win32.ActiveCfg = Release|Win32
79
+ {104CFCC9-11DF-4894-894B-BFE5F5C13DCA}.Release|Win32.Build.0 = Release|Win32
80
+ {98C25734-1D4B-48A7-B8B2-D6559410FF3F}.Debug|Win32.ActiveCfg = Debug|Win32
81
+ {98C25734-1D4B-48A7-B8B2-D6559410FF3F}.Debug|Win32.Build.0 = Debug|Win32
82
+ {98C25734-1D4B-48A7-B8B2-D6559410FF3F}.Release|Win32.ActiveCfg = Release|Win32
83
+ {98C25734-1D4B-48A7-B8B2-D6559410FF3F}.Release|Win32.Build.0 = Release|Win32
84
+ {24807515-7B42-4E76-B630-E82BDA83845C}.Debug|Win32.ActiveCfg = Debug|Win32
85
+ {24807515-7B42-4E76-B630-E82BDA83845C}.Debug|Win32.Build.0 = Debug|Win32
86
+ {24807515-7B42-4E76-B630-E82BDA83845C}.Release|Win32.ActiveCfg = Release|Win32
87
+ {F1876AD7-43C2-4D95-BB45-E1EAED974C75}.Debug|Win32.ActiveCfg = Debug|Win32
88
+ {F1876AD7-43C2-4D95-BB45-E1EAED974C75}.Debug|Win32.Build.0 = Debug|Win32
89
+ {F1876AD7-43C2-4D95-BB45-E1EAED974C75}.Release|Win32.ActiveCfg = Release|Win32
90
+ {B20AE738-2F4F-4E96-A673-F5A02591D50E}.Debug|Win32.ActiveCfg = Debug|Win32
91
+ {B20AE738-2F4F-4E96-A673-F5A02591D50E}.Debug|Win32.Build.0 = Debug|Win32
92
+ {B20AE738-2F4F-4E96-A673-F5A02591D50E}.Release|Win32.ActiveCfg = Release|Win32
93
+ {594A9352-4170-4F5D-AEB3-E6C96DA2E87F}.Debug|Win32.ActiveCfg = Debug|Win32
94
+ {594A9352-4170-4F5D-AEB3-E6C96DA2E87F}.Debug|Win32.Build.0 = Debug|Win32
95
+ {594A9352-4170-4F5D-AEB3-E6C96DA2E87F}.Release|Win32.ActiveCfg = Release|Win32
96
+ {27D9F340-49F7-4715-B77D-B44CE57B7CBD}.Debug|Win32.ActiveCfg = Debug|Win32
97
+ {27D9F340-49F7-4715-B77D-B44CE57B7CBD}.Debug|Win32.Build.0 = Debug|Win32
98
+ {27D9F340-49F7-4715-B77D-B44CE57B7CBD}.Release|Win32.ActiveCfg = Release|Win32
99
+ {EC73A2FE-5D85-45C3-A223-37737C823476}.Debug|Win32.ActiveCfg = Debug|Win32
100
+ {EC73A2FE-5D85-45C3-A223-37737C823476}.Debug|Win32.Build.0 = Debug|Win32
101
+ {EC73A2FE-5D85-45C3-A223-37737C823476}.Release|Win32.ActiveCfg = Release|Win32
102
+ {EC73A2FE-5D85-45C3-A223-37737C823476}.Release|Win32.Build.0 = Release|Win32
103
+ {C4C7BA27-B713-47C0-92B1-FF70EAC9A373}.Debug|Win32.ActiveCfg = Debug|Win32
104
+ {C4C7BA27-B713-47C0-92B1-FF70EAC9A373}.Debug|Win32.Build.0 = Debug|Win32
105
+ {C4C7BA27-B713-47C0-92B1-FF70EAC9A373}.Release|Win32.ActiveCfg = Release|Win32
106
+ {C4C7BA27-B713-47C0-92B1-FF70EAC9A373}.Release|Win32.Build.0 = Release|Win32
107
+ {B4B56EF0-681D-4B32-AD14-F855D67CB01B}.Debug|Win32.ActiveCfg = Debug|Win32
108
+ {B4B56EF0-681D-4B32-AD14-F855D67CB01B}.Debug|Win32.Build.0 = Debug|Win32
109
+ {B4B56EF0-681D-4B32-AD14-F855D67CB01B}.Release|Win32.ActiveCfg = Release|Win32
110
+ {B4B56EF0-681D-4B32-AD14-F855D67CB01B}.Release|Win32.Build.0 = Release|Win32
111
+ {3BE97421-D962-4330-815B-AC9B7B799F15}.Debug|Win32.ActiveCfg = Debug|Win32
112
+ {3BE97421-D962-4330-815B-AC9B7B799F15}.Debug|Win32.Build.0 = Debug|Win32
113
+ {3BE97421-D962-4330-815B-AC9B7B799F15}.Release|Win32.ActiveCfg = Release|Win32
114
+ {3BE97421-D962-4330-815B-AC9B7B799F15}.Release|Win32.Build.0 = Release|Win32
115
+ {2B7CDB51-C796-4CD2-82ED-F782C7952204}.Debug|Win32.ActiveCfg = Debug|Win32
116
+ {2B7CDB51-C796-4CD2-82ED-F782C7952204}.Debug|Win32.Build.0 = Debug|Win32
117
+ {2B7CDB51-C796-4CD2-82ED-F782C7952204}.Release|Win32.ActiveCfg = Release|Win32
118
+ {2B7CDB51-C796-4CD2-82ED-F782C7952204}.Release|Win32.Build.0 = Release|Win32
119
+ EndGlobalSection
120
+ GlobalSection(SolutionProperties) = preSolution
121
+ HideSolutionNode = FALSE
122
+ EndGlobalSection
123
+ EndGlobal
Binary file
@@ -31,6 +31,11 @@ module Melisa
31
31
  end
32
32
  alias :[] :get
33
33
 
34
+ def set(key, value)
35
+ add(raw_key(key, value))
36
+ end
37
+ alias :[]= :set
38
+
34
39
  # Search for many results with a given prefix
35
40
  def get_all(key)
36
41
  build unless @built
data/lib/melisa/trie.rb CHANGED
@@ -31,6 +31,8 @@ module Melisa
31
31
  @built = true
32
32
  end
33
33
 
34
+ # Note: weight is not the same thing as a value! use a BytesTrie
35
+ # or IntTrie subclass if you want a key/value dictionary
34
36
  def add(key, weight=nil)
35
37
  raise ImmutableError, "Can't add #{key}, Trie already built" if @built
36
38
  self.tap { push(key, weight) }
@@ -1,3 +1,3 @@
1
1
  module Melisa
2
- VERSION = '0.1.0'
2
+ VERSION = '0.2.0'
3
3
  end
data/melisa.gemspec CHANGED
@@ -6,7 +6,7 @@ require 'melisa/version'
6
6
  Gem::Specification.new do |gem|
7
7
  gem.name = "melisa"
8
8
  gem.summary = "Melisa is a Rubyesque wrapper for the Marisa Trie C library"
9
- gem.description = "While marisa-trie provides a ruby binding, it is not particularly rubyesque. Melisa fixes that."
9
+ gem.description = "Melisa installs the marisa-trie C library and makes a ruby class Melisa::Trie that is an easy interface."
10
10
  gem.homepage = "http://github.com/wordtreefoundation/melisa"
11
11
  gem.authors = ['Duane Johnson']
12
12
  gem.email = ['duane.johnson@gmail.com']
@@ -17,10 +17,9 @@ Gem::Specification.new do |gem|
17
17
  gem.files += Dir.glob("spec/**/*")
18
18
 
19
19
  # Configure marisa external C library
20
- gem.files += Dir.glob("ext/**/*.h")
21
- gem.files += Dir.glob("ext/**/*.cc")
22
- gem.files += Dir.glob("ext/**/*.cxx")
23
- gem.files += Dir.glob("ext/**/extconf.rb")
20
+ gem.files += Dir.glob("ext/*.h")
21
+ gem.files += Dir.glob("ext/*.cxx")
22
+ gem.files += Dir.glob("ext/marisa-*/**/*")
24
23
  gem.platform = Gem::Platform::RUBY
25
24
  gem.extensions = Dir['ext/**/extconf.rb']
26
25
 
@@ -29,8 +28,7 @@ Gem::Specification.new do |gem|
29
28
  gem.version = Melisa::VERSION
30
29
  gem.required_ruby_version = '>= 1.9.0'
31
30
 
32
- gem.add_development_dependency "rake"
33
- gem.add_development_dependency "bundler", ">= 1.0.0"
34
- gem.add_development_dependency "rspec", "~> 2.6"
35
- gem.add_development_dependency "debugger"
31
+ gem.add_development_dependency "rake", "~> 10.3"
32
+ gem.add_development_dependency "bundler", "~> 1.7"
33
+ gem.add_development_dependency "rspec", "~> 3.1"
36
34
  end
@@ -10,7 +10,12 @@ describe Melisa::BytesTrie do
10
10
  trie['onetwo'].should == '3'
11
11
  end
12
12
 
13
+ it "sets and gets values" do
14
+ trie['five'] = "5"
15
+ expect(trie['five']).to eq "5"
16
+ end
17
+
13
18
  it "retreives many values by prefix" do
14
- trie.get_all('one').should =~ ['1', '3']
19
+ expect(trie.get_all('one')).to match_array ['1', '3']
15
20
  end
16
21
  end
@@ -10,6 +10,11 @@ describe Melisa::IntTrie do
10
10
  trie['onetwo'].should == 3
11
11
  end
12
12
 
13
+ it "sets and gets values" do
14
+ trie['five'] = 5
15
+ expect(trie['five']).to eq 5
16
+ end
17
+
13
18
  it "retreives many values by prefix" do
14
19
  trie.get_all('one').should =~ [1, 3]
15
20
  end
data/spec/search_spec.rb CHANGED
@@ -13,17 +13,16 @@ describe Melisa::Search do
13
13
  end
14
14
 
15
15
  it "implements enumerable methods" do
16
- trie.all? { |k| k.include? 'o' }.should be_true
17
- trie.any? { |k| k.include? 'z' }.should_not be_true
18
- trie.map { |k| k.upcase }.should =~ ['ONE', 'TWO', 'ONETWO']
16
+ expect(trie.all? { |k| k.include? 'o' }).to be_truthy
17
+ expect(trie.any? { |k| k.include? 'z' }).to be_falsy
18
+ expect(trie.map { |k| k.upcase }).to match_array ['ONE', 'TWO', 'ONETWO']
19
19
  end
20
20
 
21
21
  it "narrows the search" do
22
22
  subset = trie.search('one')
23
- subset.should be_a(Melisa::Search)
24
- subset.size.should == 2
25
- subset.keys.should =~ ['one', 'onetwo']
26
- # subset.map { |k| k.upcase }.should =~ ['ONE', 'ONETWO']
23
+ expect(subset).to be_a(Melisa::Search)
24
+ expect(subset.size).to eq 2
25
+ expect(subset.keys).to match_array ['one', 'onetwo']
27
26
  end
28
27
 
29
28
  end