rmmseg-cpp 0.2.5 → 0.2.6

Sign up to get free protection for your applications and to get access to all the features.
data/History.txt CHANGED
@@ -1,3 +1,7 @@
1
+ == 0.2.6 / 2008-08-14
2
+
3
+ * Fix the problem that hang up when required (OS: MacOSX-Leopard)
4
+
1
5
  == 0.2.5 / 2008-06-07
2
6
 
3
7
  * Created homepage on Rubyforge.
data/Manifest.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  History.txt
2
2
  Manifest.txt
3
- README.txt
3
+ README
4
4
  Rakefile
5
5
  bin/rmmseg
6
6
  data/chars.dic
@@ -22,12 +22,15 @@ lib/rmmseg/dictionary.rb
22
22
  lib/rmmseg/ferret.rb
23
23
  misc/convert.rb
24
24
  misc/ferret_example.rb
25
+ misc/homepage.erb
26
+ misc/homepage.html
25
27
  spec/rmmseg_spec.rb
26
28
  spec/spec_helper.rb
27
29
  tasks/ann.rake
28
30
  tasks/bones.rake
29
31
  tasks/gem.rake
30
32
  tasks/git.rake
33
+ tasks/homepage.rake
31
34
  tasks/manifest.rake
32
35
  tasks/notes.rake
33
36
  tasks/post_load.rake
File without changes
data/Rakefile CHANGED
@@ -8,7 +8,7 @@ require 'rmmseg'
8
8
  task :default => 'spec:run'
9
9
 
10
10
  PROJ.name = 'rmmseg-cpp'
11
- PROJ.version = '0.2.5'
11
+ PROJ.version = '0.2.6'
12
12
  PROJ.authors = 'pluskid'
13
13
  PROJ.email = 'pluskid@gmail.com'
14
14
  PROJ.url = 'http://rmmseg-cpp.rubyforge.org'
@@ -1,9 +1,16 @@
1
1
  require 'mkmf'
2
2
 
3
+ CONFIG['LDSHARED'] = CONFIG['LDSHARED'].sub(/^\$\(CC\)/, 'g++')
4
+
5
+ # if RUBY_PLATFORM =~ /darwin/
6
+ # # CONFIG['LDSHARED'] = 'g++ --dynamiclib -flat_namespace -undefined suppress'
7
+ # CONFIG['LDSHARED'] = 'g++ --dynamiclib'
8
+ # elsif RUBY_PLATFORM =~ /linux/
9
+ # CONFIG['LDSHARED'] = 'g++ -shared'
10
+ # end
11
+
3
12
  if RUBY_PLATFORM =~ /darwin/
4
- CONFIG['LDSHARED'] = 'g++ --dynamiclib -flat_namespace -undefined suppress'
5
- else
6
- CONFIG['LDSHARED'] = 'g++ -shared'
13
+ CONFIG['LDShARED'] = 'g++ -dynamiclib -single_module -flat_namespace -undefined suppress'
7
14
  end
8
15
 
9
16
  $objs = ['algor.o', 'dict.o', 'memory.o', 'rmmseg.o']
data/misc/homepage.erb ADDED
@@ -0,0 +1,179 @@
1
+ <%# -*- mode: text; coding: utf-8 -*- %>
2
+ <%
3
+ $title = "rmmseg-cpp Homepage"
4
+ $authors = { 'pluskid' => 'http://pluskid.lifegoo.com' }
5
+ %>
6
+
7
+ <% chapter "Introduction" do %>
8
+
9
+ rmmseg-cpp is a high performance Chinese word segmentation utility for
10
+ Ruby. It features full "Ferret":http://ferret.davebalmain.com/ integration
11
+ as well as support for normal Ruby program usage.
12
+
13
+ rmmseg-cpp is a re-written of the original
14
+ "RMMSeg":http://rmmseg.rubyforge.org/ gem in C++. RMMSeg is written
15
+ in pure Ruby. Though I tried hard to tweak RMMSeg, it just consumes
16
+ lots of memory and the segmenting process is rather slow.
17
+
18
+ The interface is almost identical to RMMSeg but the performance is
19
+ much better. This gem is always preferable in production
20
+ use. However, if you want to understand how the MMSEG segmenting
21
+ algorithm works, the source code of RMMSeg is a better choice than
22
+ this.
23
+
24
+ <% end %>
25
+
26
+ <% chapter "Setup" do %>
27
+ <% section "Requirements" do %>
28
+
29
+ Your system needs the following software to run RMMSeg.
30
+
31
+ |_. Software |_. Notes |
32
+ | "Ruby":http://ruby-lang.org | Version 1.8.x is required |
33
+ | RubyGems | rmmseg-cpp is released as a gem |
34
+ | g++ | Used to build the native extension |
35
+
36
+ <% end %>
37
+
38
+ <% section "Installation" do %>
39
+ <% section "Using RubyGems" do %>
40
+ To install the gem remotely from "RubyForge":http://rubyforge.org:
41
+
42
+ sudo gem install rmmseg-cpp
43
+
44
+ Or you can download the gem file manually from
45
+ "RubyForge":http://rubyforge.org/projects/rmmseg-cpp/ and
46
+ install it locally:
47
+
48
+ sudo gem install --local rmmseg-cpp-x.y.z.gem
49
+
50
+ <% end %>
51
+
52
+ <% section "From Git" do %>
53
+ To build the gem manually from the latest source code. You'll
54
+ need to have *git* and *rake* installed.
55
+
56
+ <% warning "The latest source code may be unstable" do %>
57
+
58
+ While I tried to avoid such kind of problems, the source
59
+ code from the repository might still be broken sometimes.
60
+ It is generally not recommended to follow the source code.
61
+
62
+ <% end %>
63
+
64
+ The source code of rmmseg-cpp is hosted at
65
+ "GitHub":http://github.com/pluskid/rmmseg-cpp/. You can get the
66
+ source code by git clone:
67
+
68
+ git clone git://github.com/pluskid/rmmseg-cpp.git
69
+
70
+ then you can use Rake to build and install the gem:
71
+
72
+ cd rmmseg-cpp
73
+ rake gem:install
74
+
75
+ <% end %>
76
+ <% end %>
77
+ <% end %>
78
+
79
+ <% chapter "Usage" do %>
80
+
81
+ <% section "Stand Alone rmmseg" do %>
82
+ rmmseg-cpp comes with a script *rmmseg*. To get the basic usage, just execute it with <tt>-h</tt> option:
83
+
84
+ rmmseg -h
85
+
86
+ It reads from STDIN and print result to STDOUT. Here is a real
87
+ example:
88
+
89
+ $ echo "我们都喜欢用 Ruby" | rmmseg
90
+ 我们 都 喜欢 用 Ruby
91
+
92
+ <% end %>
93
+
94
+ <% section "Use in Ruby program" do %>
95
+
96
+ <% section "Initialize" do %>
97
+
98
+ To use rmmseg-cpp in Ruby program, you'll first load it with RubyGems:
99
+
100
+ <code>
101
+ require 'rubygems'
102
+ require 'rmmseg'
103
+ </code>
104
+
105
+ Then you may customize the dictionaries used by rmmseg-cpp
106
+ (see "the rdoc":http://rmmseg-cpp.rubyforge.org/rdoc/classes/RMMSeg/Dictionary.html on
107
+ how to add your own dictionaries) and load all dictionaries:
108
+
109
+ <code>
110
+ RMMSeg::Dictionary.load_dictionaries
111
+ </code>
112
+
113
+ Now rmmseg-cpp will be ready to do segmenting.
114
+
115
+ <% end %>
116
+
117
+ <% section "Ferret Integration" do %>
118
+
119
+ To use rmmseg-cpp with Ferret, you'll need to @require@ the
120
+ Ferret support of rmmseg-cpp (Of course you'll also have to
121
+ got Ferret installed. If you have problems running the belowing
122
+ example, please try to update to the latest version of both
123
+ Ferret and rmmseg-cpp first):
124
+
125
+ <code>
126
+ require 'rmmseg/ferret'
127
+ </code>
128
+
129
+ rmmseg-cpp comes with a ready to use Ferret analyzer:
130
+
131
+ <code>
132
+ analyzer = RMMSeg::Ferret::Analyzer.new { |tokenizer|
133
+ Ferret::Analysis::LowerCaseFilter.new(tokenizer)
134
+ }
135
+ index = Ferret::Index::Index.new(:analyzer => analyzer)
136
+ </code>
137
+
138
+ A complete example can be found in <tt>misc/ferret_example.rb</tt>. The result
139
+ of running that example is shown in <%= xref "Ferret Example Screenshot" %>.
140
+
141
+ <% figure "Ferret Example Screenshot" do %>
142
+ !http://pluskid.lifegoo.com/wp-content/uploads/2008/02/rmmseg.png!
143
+ <% end %>
144
+
145
+ <% end %>
146
+
147
+ <% section "Normal Ruby program" do %>
148
+ rmmseg-cpp can also be used in normal Ruby programs. Just create
149
+ an @Algorithm@ object and call @next_token@ until a @nil@ is returned:
150
+
151
+ <code>
152
+ algor = RMMSeg::Algorithm.new(text)
153
+ loop do
154
+ tok = algor.next_token
155
+ break if tok.nil?
156
+ puts "#{tok.text} [#{tok.start}..#{tok.end}]"
157
+ end
158
+ </code>
159
+ <% end %>
160
+ <% end %>
161
+
162
+ <% end %>
163
+
164
+ <% chapter "Who use it" do %>
165
+ <% tip "Expand this list" do %>
166
+ If you used rmmseg-cpp and would like your project to
167
+ appear in this list, please "contact me":mailto:pluskid@gmail.com.
168
+ <% end %>
169
+
170
+ * "JavaEye":http://www.javaeye.com/: One of the biggest software developper
171
+ community in China.
172
+ <% end %>
173
+
174
+ <% chapter "Resources" do %>
175
+ * "Project Home":http://rubyforge.org/projects/rmmseg-cpp/: The Project page at RubyForge.
176
+ * "RDoc of rmmseg-cpp":http://rmmseg-cpp.rubyforge.org/rdoc/index.html: The auto generated rdoc of RMMSeg.
177
+ * "Free Mind":http://pluskid.lifegoo.com/: The author's blog.
178
+ * "Author's Email":mailto:pluskid@gmail.com: Contact me if you have any problem.
179
+ <% end %>
@@ -0,0 +1,1202 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml">
4
+ <head>
5
+ <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
6
+ <meta name="date" content="14 August 2008"/>
7
+ <meta name="author" content="pluskid"/>
8
+ <meta name="generator" content="Gerbil 3.1.0"/>
9
+ <title>rmmseg-cpp Homepage</title>
10
+
11
+ <style type="text/css" media="all">
12
+ <!--
13
+ .icon-warning {
14
+ display: list-item;
15
+ list-style-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAN1wAADdcBQiibeAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAlSSURBVGiB1ZpJjFzFGcd/31t6ncWzeHrGG15JwBAcjAGDkwtJDPIgnAgh+UAkDlzgFHHIzQeOUXKJAheUE1IQEoqMMiZBkSMQToxkx2DMImMbg5cZz7jbs3W/3t6rL4funnm9zoxnEiklleq9qn9X/f9ffVWvlhZV5f85OGtSi4iMwT4LDtsi9wObDaQC1X4AW+S2BZPAtUD1vIFjo3CaNbCerKaOMZEnbMt6XlWf6Uml7M337U50pYbsSFcXkZ4u3HgCTEDZ8yhls5Tm5pmfmAiufXXBm7+VDkTk3cCYN0dVT/xPBYyJ7LdFXutav37Xzr0PJgfuuVvcaAymZyCbhVIZiiUolys/cF2IuhCJQFcSeropFwukL3ytl8+ey2VvpS8Gqi+Pqp76rwo4JrIjKvK629tzYM+PHo8P3LtbyNyGTAb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+C7pjXD953jP50tpccIREHFTbemfDnrsT67akrMKlcYpXJjBmcQV6J0sELIvYthTxnSPMXZsyU+e+8SQwa3vFBCAizm/g+7vg97HuxKMbfrAzlhjolcKVCUoTGYJcoZko7d3HTsZwh/uIb0+Rz8zrzfNXCt68d+ZD+PUf4GugBBRVtbQqASLiAjEgWkt/BY88Bkd7Bnu3DGwbiXWNDApln9LEbfzZHEGxhMkXCYqVa1aJuljRCFbMxe5NEh3pQ10HbzyjmW8nCrOZ+Rt/h9/+Ec4CBaDYkBZUtbhiASLiAPEq8VjDc+xF2P8g/GwYHokN9NjrNg5Goj1Jy4lFsGMRnJiLAkGhjF8o4ueLFOZyZmY8Uy5m5s11OPsxfPgnOFMjCuSrxPOh97YiViWglmdD/Em451F4eD1sTkB/DLojFTxFKOQhl4WZKRj/F3z6D7hoQuSWISCrqk371eW4kFUlXiMfbUgj1edIKLqAXY1SjQoE1ViuxlIoFkLpgusAWSrWb7lfXckglhDZeDV1Q4RdKvsLJ0S+9qGsCaitOgLAbyGmDHhUra6q5SV53emfPaqCrBDpMPlaalVjI/la9EMCgnZW7hT+A5SLlrQmK/qkAAAAAElFTkSuQmCC);
16
+ list-style-position: inside;
17
+ }
18
+ .icon-tip {
19
+ display: list-item;
20
+ list-style-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAN1wAADdcBQiibeAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAyOSURBVGiB1ZlrkB3Fdcf/5/Q87r1z7z7uvrSrXa3QC7EIyUFCSWwnJIANFiGJXdQSICRllGDni4LjqviDnQ+ufHEKx2BXygg9cEwVriBcMsZOHFlEWCo/glFhrAeSxe6ifWnvPu7evc+Z6Z6ezoe7S7aUQO1qF5N01anpmaqZ/v/6nNMzfYaMMfj/3Pj9FrDSZq3Wg4iIPvnIX+8G2fcS2R+BiTtMHGU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4tUAjBxLyYnZ/54NQBW7IGjRy/kS6XwRxcvFmFiAZgYWkfQWsMYg+bmDLq62rGmoxlCCFRrIaam52AMzv+fAPjEJza1Z1vSt+3c2Y7W1puQ9vqQcP87hIQQICJEWmN8fBbGMNZ1t8N27Fv27NncvdLxVxxCUiY41pqCQOLqENKxwVyhjOnpPCqVKnrWtSE/ncfgTB5kjC4WQ0NENuq1VXMtP/6uCYCIeP5eBlC+664tf3/06MXPT+Rsa+PGMazp7EIy5aFSriKfL2Bqchpzc3OolMoYHcvhypWcqtXk53/601EfgId65U4TkZ7vR8aYeElalgNNRGJe+OKjACB27Oja1NqaujuZbLjb89Lbk0kL5fIc4ljDcTyEYQSl1PlKpfDi5cul7w8Pz+YAKMxXtq+yaOFo6n9OVg5ARNa86MUAC30HgAsgsWvXrt/cunXrEw899FDSdV0UCgUMDQ3hlVdeCS5evPh3Z86ceW1eeDhvwfxRLhIfLe4bY6J30rWkJJ4PmXcyaxGAe/r06Yu+74+dOHFCTU5OIp/P480334zCMMydOXNmDEAGQApAYuGe+futdxqDiOgdta22BwC4nZ2dXdu2bfujlpaWe4wxNDMz84OzZ88em5qamkZ9ppfjAflu+bDcHGAANv6XHFhk9iI4CwDNm5m3aJG9Ww4o1MPnXQVe09fovEsXBC+AXO16LBK/0BYggPpqs9jeBlvqCnTNAP/jIXWgBeNF/YXzBfHxIoC3z5cj+Or2X3r9Ye2F1izgAAAAAElFTkSuQmCC);
21
+ list-style-position: inside;
22
+ }
23
+ -->
24
+ </style>
25
+
26
+ <style type="text/css" media="screen">
27
+ <!--
28
+ body
29
+ {
30
+ color : #000000;
31
+ background-color : #FFFFFF;
32
+ line-height : 1.5em;
33
+ font-family : Calibri, Verdana, sans-serif;
34
+ }
35
+
36
+ /* emphasis */
37
+
38
+ em,
39
+ blockquote
40
+ {
41
+ font-family : Cambria, Georgia, serif;
42
+ }
43
+
44
+ blockquote
45
+ {
46
+ margin : 1em;
47
+ border : 5px dotted #ddd;
48
+ padding : 1em;
49
+ }
50
+
51
+ hr
52
+ {
53
+ height : 0;
54
+ border : 0;
55
+ border-top : 2px solid #FF0000;
56
+ }
57
+
58
+ /* source code */
59
+
60
+ tt,
61
+ code,
62
+ pre
63
+ {
64
+ font-family : Consolas, "Lucida Console", monospace;
65
+ }
66
+
67
+ tt
68
+ {
69
+ font-weight : bold;
70
+ color : #A52A2A;
71
+ background-color : #FFFAF0;
72
+ }
73
+
74
+ /* output of the syntax coloring library */
75
+ .code
76
+ {
77
+ background-color : #FFFFF0;
78
+ }
79
+
80
+ pre
81
+ {
82
+ cursor : text;
83
+ line-height : normal;
84
+ border : 1px dashed #C0C0C0;
85
+ background-color : #F5FFDF;
86
+ padding : 1em;
87
+ overflow : auto;
88
+ }
89
+
90
+ /* hyperlinks */
91
+
92
+ a > img
93
+ {
94
+ border : none;
95
+ }
96
+
97
+ a img
98
+ {
99
+ _border : none; /* for IE6 */
100
+ }
101
+
102
+ a.here:link,
103
+ a.here:visited
104
+ {
105
+ color : #000000;
106
+ }
107
+
108
+ /* lists */
109
+
110
+ #content li:first-child
111
+ {
112
+ margin-top : 1em;
113
+ }
114
+
115
+ #content li
116
+ {
117
+ margin-bottom : 1em;
118
+ }
119
+
120
+ /* headings */
121
+
122
+ h1,
123
+ h2,
124
+ h3,
125
+ h4,
126
+ h5,
127
+ h6,
128
+ .title
129
+ {
130
+ font-weight : lighter;
131
+ font-family : Constantia, "Book Antiqua", "URW Bookman L", serif;
132
+ }
133
+
134
+ #lof h1,
135
+ #lof h2,
136
+ #lof h3,
137
+ #lof h4,
138
+ #lof h5,
139
+ #lof h6
140
+ {
141
+ margin-top : 1.25em;
142
+ }
143
+
144
+ #content h1,
145
+ #content h2,
146
+ #content h3,
147
+ #content h4,
148
+ #content h5,
149
+ #content h6
150
+ {
151
+ margin-top : 2.5em;
152
+ line-height : 1.25em;
153
+ }
154
+
155
+ #content h1
156
+ {
157
+ font-size : 2.0em;
158
+ }
159
+
160
+ #content h2
161
+ {
162
+ font-size : 1.8em;
163
+ }
164
+
165
+ #content h3
166
+ {
167
+ font-size : 1.6em;
168
+ }
169
+
170
+ #content h4
171
+ {
172
+ font-size : 1.4em;
173
+ }
174
+
175
+ #content h5
176
+ {
177
+ font-size : 1.2em;
178
+ }
179
+
180
+ #content h6
181
+ {
182
+ font-size : 1.0em;
183
+ }
184
+
185
+ /* tables */
186
+
187
+ table
188
+ {
189
+ border-collapse : collapse; /* no spacing between cell borders */
190
+ margin : auto; /* center horizontally */
191
+ margin-top : 1em;
192
+ }
193
+
194
+ th,
195
+ td
196
+ {
197
+ padding : 1em;
198
+ border : 1px solid #bbb;
199
+ vertical-align : top;
200
+ background-color : inherit;
201
+ }
202
+
203
+ th
204
+ {
205
+ background-color : #F5F5F5;
206
+ }
207
+
208
+ /* document structure */
209
+
210
+ .nav
211
+ {
212
+ text-align : center;
213
+ border-bottom : thick dotted #DCDCDC;
214
+ padding-bottom : 1em;
215
+ margin-bottom : 4em;
216
+ }
217
+
218
+ #header
219
+ {
220
+ text-align : center;
221
+ }
222
+
223
+ .header_outside_above,
224
+ #header,
225
+ .header_outside_below
226
+ {
227
+ margin-bottom : 5em;
228
+ }
229
+
230
+ .footer_outside_above,
231
+ #footer,
232
+ .footer_outside_below
233
+ {
234
+ margin-top : 5em;
235
+ }
236
+
237
+ #header .header_inside_above,
238
+ #footer .footer_inside_above
239
+ {
240
+ margin-bottom : 4em;
241
+ }
242
+
243
+ #header .header_inside_below,
244
+ #footer .footer_inside_below
245
+ {
246
+ margin-top : 4em;
247
+ }
248
+
249
+ #Abstract
250
+ {
251
+ margin-bottom : 5em;
252
+ }
253
+
254
+ #Contents li
255
+ {
256
+ list-style-type : none;
257
+ }
258
+
259
+ #Contents li ul
260
+ {
261
+ padding-bottom : 1em;
262
+ border-left : thick solid #F5F5F5;
263
+ _border-left : none; /* for IE6 */
264
+ }
265
+
266
+ #Contents li ul:hover
267
+ {
268
+ border-color : #DCDCDC;
269
+ }
270
+
271
+ #Contents > ul
272
+ {
273
+ padding-left : 1em;
274
+ }
275
+
276
+ #References
277
+ {
278
+ margin-top : 5em;
279
+ }
280
+
281
+ #footer
282
+ {
283
+ border-top : thick dotted #DCDCDC;
284
+ padding-top : 1em;
285
+ text-align : center;
286
+ }
287
+
288
+ #footer-credits
289
+ {
290
+ margin-top : 2em;
291
+ }
292
+
293
+ /* document nodes */
294
+
295
+ .part > .title,
296
+ .chapter > .title
297
+ {
298
+ padding-bottom : 0.5em;
299
+ }
300
+
301
+ .part > .title > big,
302
+ .chapter > .title > big
303
+ {
304
+ display : block;
305
+ margin-top : 0.25em;
306
+ }
307
+
308
+ .part .title big,
309
+ .chapter .title big
310
+ {
311
+ _display : block; /* for IE6 */
312
+ _margin-top : 0.25em; /* for IE6 */
313
+ _margin-bottom : 0.75em; /* for IE6 */
314
+ }
315
+
316
+ .paragraph > .title,
317
+ .tip > .title,
318
+ .note > .title,
319
+ .caution > .title,
320
+ .warning > .title,
321
+ .important > .title,
322
+ .figure > .title,
323
+ .table > .title,
324
+ .example > .title,
325
+ .equation > .title,
326
+ .procedure > .title
327
+ {
328
+ font-size : large;
329
+ margin-top : 2em;
330
+ }
331
+
332
+ .paragraph .title,
333
+ .tip .title,
334
+ .note .title,
335
+ .caution .title,
336
+ .warning .title,
337
+ .important .title,
338
+ .figure .title,
339
+ .table .title,
340
+ .example .title,
341
+ .equation .title,
342
+ .procedure .title
343
+ {
344
+ _font-size : large; /* for IE6 */
345
+ _font-weight : bold; /* large is not bold in IE6 */
346
+ _margin-top : 2em; /* for IE6 */
347
+ }
348
+
349
+ .tip ,
350
+ .note ,
351
+ .caution ,
352
+ .warning ,
353
+ .important,
354
+ .figure ,
355
+ .table ,
356
+ .example ,
357
+ .equation ,
358
+ .procedure
359
+ {
360
+ margin : 3em;
361
+ }
362
+
363
+ .tip > .icon,
364
+ .note > .icon,
365
+ .caution > .icon,
366
+ .warning > .icon,
367
+ .important > .icon
368
+ {
369
+ float : left;
370
+ margin : 0 1em 1em 0; /* top right bottom left */
371
+ }
372
+
373
+ .tip .icon,
374
+ .note .icon,
375
+ .caution .icon,
376
+ .warning .icon,
377
+ .important .icon
378
+ {
379
+ _display : none; /* IE6 cannot display embedded images */
380
+ }
381
+
382
+ .figure > .title
383
+ {
384
+ text-align : center;
385
+ }
386
+
387
+ .figure .title
388
+ {
389
+ _text-align : center; /* for IE6 */
390
+ }
391
+
392
+ .figure > .content img
393
+ {
394
+ display : block;
395
+ margin : auto;
396
+ }
397
+
398
+ .figure .content img
399
+ {
400
+ _display : block; /* for IE6 */
401
+ _margin : auto; /* for IE6 */
402
+ }
403
+
404
+ body
405
+ {
406
+ margin : auto;
407
+ padding : 0.5em;
408
+ max-width : 36em;
409
+ }
410
+
411
+ /* hyperlinks */
412
+
413
+ a:link
414
+ {
415
+ color : #0000FF;
416
+ text-decoration : none;
417
+ }
418
+
419
+ a:visited
420
+ {
421
+ color : #800080;
422
+ text-decoration : none;
423
+ }
424
+
425
+ a:hover
426
+ {
427
+ color : #FF0000;
428
+ text-decoration : underline;
429
+ }
430
+
431
+ a:target
432
+ {
433
+ color : #FF0000;
434
+ font-weight : bold;
435
+ }
436
+
437
+ -->
438
+ </style>
439
+ <style type="text/css" media="print">
440
+ <!--
441
+ body
442
+ {
443
+ color : #000000;
444
+ background-color : #FFFFFF;
445
+ line-height : 1.5em;
446
+ font-family : Calibri, Verdana, sans-serif;
447
+ }
448
+
449
+ /* emphasis */
450
+
451
+ em,
452
+ blockquote
453
+ {
454
+ font-family : Cambria, Georgia, serif;
455
+ }
456
+
457
+ blockquote
458
+ {
459
+ margin : 1em;
460
+ border : 5px dotted #ddd;
461
+ padding : 1em;
462
+ }
463
+
464
+ hr
465
+ {
466
+ height : 0;
467
+ border : 0;
468
+ border-top : 2px solid #FF0000;
469
+ }
470
+
471
+ /* source code */
472
+
473
+ tt,
474
+ code,
475
+ pre
476
+ {
477
+ font-family : Consolas, "Lucida Console", monospace;
478
+ }
479
+
480
+ tt
481
+ {
482
+ font-weight : bold;
483
+ color : #A52A2A;
484
+ background-color : #FFFAF0;
485
+ }
486
+
487
+ /* output of the syntax coloring library */
488
+ .code
489
+ {
490
+ background-color : #FFFFF0;
491
+ }
492
+
493
+ pre
494
+ {
495
+ cursor : text;
496
+ line-height : normal;
497
+ border : 1px dashed #C0C0C0;
498
+ background-color : #F5FFDF;
499
+ padding : 1em;
500
+ overflow : auto;
501
+ }
502
+
503
+ /* hyperlinks */
504
+
505
+ a > img
506
+ {
507
+ border : none;
508
+ }
509
+
510
+ a img
511
+ {
512
+ _border : none; /* for IE6 */
513
+ }
514
+
515
+ a.here:link,
516
+ a.here:visited
517
+ {
518
+ color : #000000;
519
+ }
520
+
521
+ /* lists */
522
+
523
+ #content li:first-child
524
+ {
525
+ margin-top : 1em;
526
+ }
527
+
528
+ #content li
529
+ {
530
+ margin-bottom : 1em;
531
+ }
532
+
533
+ /* headings */
534
+
535
+ h1,
536
+ h2,
537
+ h3,
538
+ h4,
539
+ h5,
540
+ h6,
541
+ .title
542
+ {
543
+ font-weight : lighter;
544
+ font-family : Constantia, "Book Antiqua", "URW Bookman L", serif;
545
+ }
546
+
547
+ #lof h1,
548
+ #lof h2,
549
+ #lof h3,
550
+ #lof h4,
551
+ #lof h5,
552
+ #lof h6
553
+ {
554
+ margin-top : 1.25em;
555
+ }
556
+
557
+ #content h1,
558
+ #content h2,
559
+ #content h3,
560
+ #content h4,
561
+ #content h5,
562
+ #content h6
563
+ {
564
+ margin-top : 2.5em;
565
+ line-height : 1.25em;
566
+ }
567
+
568
+ #content h1
569
+ {
570
+ font-size : 2.0em;
571
+ }
572
+
573
+ #content h2
574
+ {
575
+ font-size : 1.8em;
576
+ }
577
+
578
+ #content h3
579
+ {
580
+ font-size : 1.6em;
581
+ }
582
+
583
+ #content h4
584
+ {
585
+ font-size : 1.4em;
586
+ }
587
+
588
+ #content h5
589
+ {
590
+ font-size : 1.2em;
591
+ }
592
+
593
+ #content h6
594
+ {
595
+ font-size : 1.0em;
596
+ }
597
+
598
+ /* tables */
599
+
600
+ table
601
+ {
602
+ border-collapse : collapse; /* no spacing between cell borders */
603
+ margin : auto; /* center horizontally */
604
+ margin-top : 1em;
605
+ }
606
+
607
+ th,
608
+ td
609
+ {
610
+ padding : 1em;
611
+ border : 1px solid #bbb;
612
+ vertical-align : top;
613
+ background-color : inherit;
614
+ }
615
+
616
+ th
617
+ {
618
+ background-color : #F5F5F5;
619
+ }
620
+
621
+ /* document structure */
622
+
623
+ .nav
624
+ {
625
+ text-align : center;
626
+ border-bottom : thick dotted #DCDCDC;
627
+ padding-bottom : 1em;
628
+ margin-bottom : 4em;
629
+ }
630
+
631
+ #header
632
+ {
633
+ text-align : center;
634
+ }
635
+
636
+ .header_outside_above,
637
+ #header,
638
+ .header_outside_below
639
+ {
640
+ margin-bottom : 5em;
641
+ }
642
+
643
+ .footer_outside_above,
644
+ #footer,
645
+ .footer_outside_below
646
+ {
647
+ margin-top : 5em;
648
+ }
649
+
650
+ #header .header_inside_above,
651
+ #footer .footer_inside_above
652
+ {
653
+ margin-bottom : 4em;
654
+ }
655
+
656
+ #header .header_inside_below,
657
+ #footer .footer_inside_below
658
+ {
659
+ margin-top : 4em;
660
+ }
661
+
662
+ #Abstract
663
+ {
664
+ margin-bottom : 5em;
665
+ }
666
+
667
+ #Contents li
668
+ {
669
+ list-style-type : none;
670
+ }
671
+
672
+ #Contents li ul
673
+ {
674
+ padding-bottom : 1em;
675
+ border-left : thick solid #F5F5F5;
676
+ _border-left : none; /* for IE6 */
677
+ }
678
+
679
+ #Contents li ul:hover
680
+ {
681
+ border-color : #DCDCDC;
682
+ }
683
+
684
+ #Contents > ul
685
+ {
686
+ padding-left : 1em;
687
+ }
688
+
689
+ #References
690
+ {
691
+ margin-top : 5em;
692
+ }
693
+
694
+ #footer
695
+ {
696
+ border-top : thick dotted #DCDCDC;
697
+ padding-top : 1em;
698
+ text-align : center;
699
+ }
700
+
701
+ #footer-credits
702
+ {
703
+ margin-top : 2em;
704
+ }
705
+
706
+ /* document nodes */
707
+
708
+ .part > .title,
709
+ .chapter > .title
710
+ {
711
+ padding-bottom : 0.5em;
712
+ }
713
+
714
+ .part > .title > big,
715
+ .chapter > .title > big
716
+ {
717
+ display : block;
718
+ margin-top : 0.25em;
719
+ }
720
+
721
+ .part .title big,
722
+ .chapter .title big
723
+ {
724
+ _display : block; /* for IE6 */
725
+ _margin-top : 0.25em; /* for IE6 */
726
+ _margin-bottom : 0.75em; /* for IE6 */
727
+ }
728
+
729
+ .paragraph > .title,
730
+ .tip > .title,
731
+ .note > .title,
732
+ .caution > .title,
733
+ .warning > .title,
734
+ .important > .title,
735
+ .figure > .title,
736
+ .table > .title,
737
+ .example > .title,
738
+ .equation > .title,
739
+ .procedure > .title
740
+ {
741
+ font-size : large;
742
+ margin-top : 2em;
743
+ }
744
+
745
+ .paragraph .title,
746
+ .tip .title,
747
+ .note .title,
748
+ .caution .title,
749
+ .warning .title,
750
+ .important .title,
751
+ .figure .title,
752
+ .table .title,
753
+ .example .title,
754
+ .equation .title,
755
+ .procedure .title
756
+ {
757
+ _font-size : large; /* for IE6 */
758
+ _font-weight : bold; /* large is not bold in IE6 */
759
+ _margin-top : 2em; /* for IE6 */
760
+ }
761
+
762
+ .tip ,
763
+ .note ,
764
+ .caution ,
765
+ .warning ,
766
+ .important,
767
+ .figure ,
768
+ .table ,
769
+ .example ,
770
+ .equation ,
771
+ .procedure
772
+ {
773
+ margin : 3em;
774
+ }
775
+
776
+ .tip > .icon,
777
+ .note > .icon,
778
+ .caution > .icon,
779
+ .warning > .icon,
780
+ .important > .icon
781
+ {
782
+ float : left;
783
+ margin : 0 1em 1em 0; /* top right bottom left */
784
+ }
785
+
786
+ .tip .icon,
787
+ .note .icon,
788
+ .caution .icon,
789
+ .warning .icon,
790
+ .important .icon
791
+ {
792
+ _display : none; /* IE6 cannot display embedded images */
793
+ }
794
+
795
+ .figure > .title
796
+ {
797
+ text-align : center;
798
+ }
799
+
800
+ .figure .title
801
+ {
802
+ _text-align : center; /* for IE6 */
803
+ }
804
+
805
+ .figure > .content img
806
+ {
807
+ display : block;
808
+ margin : auto;
809
+ }
810
+
811
+ .figure .content img
812
+ {
813
+ _display : block; /* for IE6 */
814
+ _margin : auto; /* for IE6 */
815
+ }
816
+
817
+ /* source code */
818
+
819
+ tt
820
+ {
821
+ background-color : inherit;
822
+ font-weight : normal;
823
+ }
824
+
825
+ pre,
826
+ .code
827
+ {
828
+ border : none;
829
+ background-color : inherit;
830
+ }
831
+
832
+ /* headings */
833
+
834
+ h1,
835
+ h2,
836
+ h3,
837
+ h4,
838
+ h5,
839
+ h6
840
+ {
841
+ font-weight : normal;
842
+ }
843
+
844
+ /* hyperlinks */
845
+
846
+ /* blend all hyperlinks with normal text */
847
+ a:link,
848
+ a:visited
849
+ {
850
+ color : #000000;
851
+ text-decoration : none;
852
+ }
853
+
854
+ /* emphasize external and cross-reference hyperlinks */
855
+ a:not([href^="#"]):link,
856
+ a:not([href^="#"]):visited,
857
+ a.xref[title]:link,
858
+ a.xref[title]:visited
859
+ {
860
+ color : #0000FF;
861
+ text-decoration : underline;
862
+ font-weight : bolder;
863
+ }
864
+
865
+ /* show URL of destination for external hyperlinks */
866
+ a:not([href^="#"]):after
867
+ {
868
+ content : " " attr(href);
869
+ font-family : Consolas, "Lucida Console", monospace;
870
+ }
871
+
872
+ /* show name of destination for cross-references */
873
+ a.xref[title]:after
874
+ {
875
+ content : " " attr(title);
876
+ }
877
+
878
+ a:after
879
+ {
880
+ font-weight : normal;
881
+ font-size : smaller;
882
+ }
883
+
884
+ /* document structure */
885
+
886
+ .nav,
887
+ #lof
888
+ {
889
+ display : none;
890
+ }
891
+
892
+ #Contents,
893
+ .part,
894
+ .chapter,
895
+ #References
896
+ {
897
+ page-break-before : always;
898
+ }
899
+
900
+ /* document nodes */
901
+
902
+ .part > .title > big,
903
+ .chapter > .title > big
904
+ {
905
+ padding-bottom : 0.5em;
906
+ }
907
+
908
+ .part .title big,
909
+ .chapter .title big
910
+ {
911
+ _padding-bottom : 0.5em; /* for IE6 */
912
+ }
913
+
914
+ -->
915
+ </style>
916
+ </head>
917
+ <body>
918
+ <div class="nav">
919
+ <a href="#Contents">Contents</a> &middot; <a href="#Figures">Figures</a> &middot; <a href="#Tips">Tips</a> &middot; <a href="#Warnings">Warnings</a>
920
+ </div>
921
+
922
+ <br style="display: none"/>
923
+ <hr style="display: none"/>
924
+ <br style="display: none"/>
925
+
926
+
927
+ <div id="header">
928
+
929
+
930
+ <h1 class="title"><a class="here" href="#">rmmseg-cpp Homepage</a></h1>
931
+ <h2 class="authors"><a href="http://pluskid.lifegoo.com">pluskid</a></h2>
932
+ <h3 class="date">14 August 2008</h3>
933
+
934
+ </div>
935
+
936
+
937
+
938
+
939
+ <br style="display: none"/>
940
+ <hr style="display: none"/>
941
+ <br style="display: none"/>
942
+
943
+ <div id="Contents">
944
+ <h1 class="title"><a class="here" href="#Contents">Contents</a></h1>
945
+ <ul>
946
+ <li>1&nbsp;&nbsp;<a id="a-605841108" href="#Introduction">Introduction</a></li><li>2&nbsp;&nbsp;<a id="a-605858498" href="#Setup">Setup</a><ul><li>2.1&nbsp;&nbsp;<a id="a-605869558" href="#Requirements">Requirements</a></li><li>2.2&nbsp;&nbsp;<a id="a-605875858" href="#Installation">Installation</a><ul><li>2.2.1&nbsp;&nbsp;<a id="a-605883808" href="#Using-RubyGems">Using RubyGems</a></li><li>2.2.2&nbsp;&nbsp;<a id="a-605892288" href="#From-Git">From Git</a></li></ul></li></ul></li><li>3&nbsp;&nbsp;<a id="a-605908088" href="#Usage">Usage</a><ul><li>3.1&nbsp;&nbsp;<a id="a-605910488" href="#Stand-Alone-rmmseg">Stand Alone rmmseg</a></li><li>3.2&nbsp;&nbsp;<a id="a-605913918" href="#Use-in-Ruby-program">Use in Ruby program</a><ul><li>3.2.1&nbsp;&nbsp;<a id="a-605916398" href="#Initialize">Initialize</a></li><li>3.2.2&nbsp;&nbsp;<a id="a-605919558" href="#Ferret-Integration">Ferret Integration</a></li><li>3.2.3&nbsp;&nbsp;<a id="a-605931938" href="#Normal-Ruby-program">Normal Ruby program</a></li></ul></li></ul></li><li>4&nbsp;&nbsp;<a id="a-605957278" href="#Who-use-it">Who use it</a></li><li>5&nbsp;&nbsp;<a id="a-605989058" href="#Resources">Resources</a></li>
947
+
948
+ </ul>
949
+ </div>
950
+
951
+ <div id="lof"><h1 id="Figures" class="title"><a class="here" href="#Figures">Figures</a></h1> <ol><li><a id="a-605925108" href="#Ferret-Example-Screenshot">Ferret Example Screenshot</a></li></ol><h1 id="Tips" class="title"><a class="here" href="#Tips">Tips</a></h1> <ol><li><a id="a-605970528" href="#Expand-this-list">Expand this list</a></li></ol><h1 id="Warnings" class="title"><a class="here" href="#Warnings">Warnings</a></h1> <ol><li><a id="a-605900448" href="#The-latest-source-code-may-be-unstable">The latest source code may be unstable</a></li></ol></div>
952
+
953
+ <br style="display: none"/>
954
+ <hr style="display: none"/>
955
+ <br style="display: none"/>
956
+
957
+ <div id="content">
958
+ <div class="chapter">
959
+ <h1 class="title">
960
+ Chapter
961
+ <a class="list" id="Introduction" href="#a-605841108">1</a>
962
+
963
+ <br/>
964
+
965
+ <a class="here" href="#Introduction"><big>Introduction</big></a>
966
+ </h1>
967
+
968
+ <div class="content"><p>rmmseg-cpp is a high performance Chinese word segmentation utility for<br />
969
+ Ruby. It features full <a href="http://ferret.davebalmain.com/">Ferret</a> integration<br />
970
+ as well as support for normal Ruby program usage.</p>
971
+ <p>rmmseg-cpp is a re-written of the original<br />
972
+ <a href="http://rmmseg.rubyforge.org/">RMMSeg</a> gem in C++. RMMSeg is written<br />
973
+ in pure Ruby. Though I tried hard to tweak RMMSeg, it just consumes<br />
974
+ lots of memory and the segmenting process is rather slow.</p>
975
+ <p>The interface is almost identical to RMMSeg but the performance is<br />
976
+ much better. This gem is always preferable in production<br />
977
+ use. However, if you want to understand how the MMSEG segmenting<br />
978
+ algorithm works, the source code of RMMSeg is a better choice than<br />
979
+ this.</p></div>
980
+ </div>
981
+ <div class="chapter">
982
+ <h1 class="title">
983
+ Chapter
984
+ <a class="list" id="Setup" href="#a-605858498">2</a>
985
+
986
+ <br/>
987
+
988
+ <a class="here" href="#Setup"><big>Setup</big></a>
989
+ </h1>
990
+
991
+ <div class="content"><div class="section">
992
+ <h2 class="title">
993
+ <a class="list" id="Requirements" href="#a-605869558">2.1</a>&nbsp;&nbsp;<a class="here" href="#Requirements">Requirements</a>
994
+ </h2>
995
+ <div class="content"><p>Your system needs the following software to run RMMSeg.</p>
996
+ <table border="1">
997
+ <tr>
998
+ <th>Software </th>
999
+ <th>Notes </th>
1000
+ </tr>
1001
+ <tr>
1002
+ <td> <a href="http://ruby-lang.org">Ruby</a> </td>
1003
+ <td> Version 1.8.x is required </td>
1004
+ </tr>
1005
+ <tr>
1006
+ <td> RubyGems </td>
1007
+ <td> rmmseg-cpp is released as a gem </td>
1008
+ </tr>
1009
+ <tr>
1010
+ <td> g++ </td>
1011
+ <td> Used to build the native extension </td>
1012
+ </tr>
1013
+ </table></div>
1014
+ </div><br />
1015
+ <div class="section">
1016
+ <h2 class="title">
1017
+ <a class="list" id="Installation" href="#a-605875858">2.2</a>&nbsp;&nbsp;<a class="here" href="#Installation">Installation</a>
1018
+ </h2>
1019
+ <div class="content"><div class="section">
1020
+ <h3 class="title">
1021
+ <a class="list" id="Using-RubyGems" href="#a-605883808">2.2.1</a>&nbsp;&nbsp;<a class="here" href="#Using-RubyGems">Using RubyGems</a>
1022
+ </h3>
1023
+ <div class="content"><p>To install the gem remotely from <a href="http://rubyforge.org">RubyForge</a>:</p>
1024
+ sudo gem install rmmseg-cpp
1025
+ <p>Or you can download the gem file manually from<br />
1026
+ <a href="http://rubyforge.org/projects/rmmseg-cpp/">RubyForge</a> and<br />
1027
+ install it locally:</p>
1028
+ sudo gem install &#8212;local rmmseg-cpp-x.y.z.gem</div>
1029
+ </div><br />
1030
+ <div class="section">
1031
+ <h3 class="title">
1032
+ <a class="list" id="From-Git" href="#a-605892288">2.2.2</a>&nbsp;&nbsp;<a class="here" href="#From-Git">From Git</a>
1033
+ </h3>
1034
+ <div class="content"><p>To build the gem manually from the latest source code. You&#8217;ll<br />
1035
+ need to have <strong>git</strong> and <strong>rake</strong> installed.</p>
1036
+ <p><div class="warning">
1037
+ <p class="title"><a class="list" id="The-latest-source-code-may-be-unstable" href="#a-605900448">Warning 1</a>.&nbsp;&nbsp;<a class="here" href="#The-latest-source-code-may-be-unstable">The latest source code may be unstable</a></p>
1038
+
1039
+ <div class="content icon-warning">While I tried to avoid such kind of problems, the source<br />
1040
+ code from the repository might still be broken sometimes.<br />
1041
+ It is generally not recommended to follow the source code.</div>
1042
+ </div> <br />
1043
+ The source code of rmmseg-cpp is hosted at<br />
1044
+ <a href="http://github.com/pluskid/rmmseg-cpp/">GitHub</a>. You can get the<br />
1045
+ source code by git clone:</p>
1046
+ git clone git://github.com/pluskid/rmmseg-cpp.git
1047
+ <p>then you can use Rake to build and install the gem:</p>
1048
+ cd rmmseg-cpp
1049
+ rake gem:install</div>
1050
+ </div></div>
1051
+ </div></div>
1052
+ </div>
1053
+ <div class="chapter">
1054
+ <h1 class="title">
1055
+ Chapter
1056
+ <a class="list" id="Usage" href="#a-605908088">3</a>
1057
+
1058
+ <br/>
1059
+
1060
+ <a class="here" href="#Usage"><big>Usage</big></a>
1061
+ </h1>
1062
+
1063
+ <div class="content"><div class="section">
1064
+ <h2 class="title">
1065
+ <a class="list" id="Stand-Alone-rmmseg" href="#a-605910488">3.1</a>&nbsp;&nbsp;<a class="here" href="#Stand-Alone-rmmseg">Stand Alone rmmseg</a>
1066
+ </h2>
1067
+ <div class="content"><p>rmmseg-cpp comes with a script <strong>rmmseg</strong>. To get the basic usage, just execute it with <tt>-h</tt> option:<br />
1068
+ <br />
1069
+ rmmseg -h</p>
1070
+ <p>It reads from STDIN and print result to STDOUT. Here is a real<br />
1071
+ example:</p>
1072
+ $ echo &#8220;我们都喜欢用 Ruby&#8221; | rmmseg
1073
+ 我们 都 喜欢 用 Ruby</div>
1074
+ </div><br />
1075
+ <div class="section">
1076
+ <h2 class="title">
1077
+ <a class="list" id="Use-in-Ruby-program" href="#a-605913918">3.2</a>&nbsp;&nbsp;<a class="here" href="#Use-in-Ruby-program">Use in Ruby program</a>
1078
+ </h2>
1079
+ <div class="content"><div class="section">
1080
+ <h3 class="title">
1081
+ <a class="list" id="Initialize" href="#a-605916398">3.2.1</a>&nbsp;&nbsp;<a class="here" href="#Initialize">Initialize</a>
1082
+ </h3>
1083
+ <div class="content"><p>To use rmmseg-cpp in Ruby program, you&#8217;ll first load it with RubyGems:</p>
1084
+ <pre class="code">
1085
+ require <span style="background-color:#fff0f0"><span style="color:#710">'</span><span style="color:#D20">rubygems</span><span style="color:#710">'</span></span>
1086
+ require <span style="background-color:#fff0f0"><span style="color:#710">'</span><span style="color:#D20">rmmseg</span><span style="color:#710">'</span></span>
1087
+ </pre>
1088
+ <p>Then you may customize the dictionaries used by rmmseg-cpp<br />
1089
+ (see <a href="http://rmmseg-cpp.rubyforge.org/rdoc/classes/RMMSeg/Dictionary.html">the rdoc</a> on<br />
1090
+ how to add your own dictionaries) and load all dictionaries:</p>
1091
+ <pre class="code">
1092
+ <span style="color:#036; font-weight:bold">RMMSeg</span>::<span style="color:#036; font-weight:bold">Dictionary</span>.load_dictionaries
1093
+ </pre>
1094
+ <p>Now rmmseg-cpp will be ready to do segmenting.</p></div>
1095
+ </div><br />
1096
+ <div class="section">
1097
+ <h3 class="title">
1098
+ <a class="list" id="Ferret-Integration" href="#a-605919558">3.2.2</a>&nbsp;&nbsp;<a class="here" href="#Ferret-Integration">Ferret Integration</a>
1099
+ </h3>
1100
+ <div class="content"><p>To use rmmseg-cpp with Ferret, you&#8217;ll need to <code class="code">require</code> the<br />
1101
+ Ferret support of rmmseg-cpp (Of course you&#8217;ll also have to<br />
1102
+ got Ferret installed. If you have problems running the belowing<br />
1103
+ example, please try to update to the latest version of both<br />
1104
+ Ferret and rmmseg-cpp first):<br />
1105
+ <br />
1106
+ <pre class="code">
1107
+ require <span style="background-color:#fff0f0"><span style="color:#710">'</span><span style="color:#D20">rmmseg/ferret</span><span style="color:#710">'</span></span>
1108
+ </pre></p>
1109
+ <p>rmmseg-cpp comes with a ready to use Ferret analyzer:<br />
1110
+ <br />
1111
+ <pre class="code">
1112
+ analyzer = <span style="color:#036; font-weight:bold">RMMSeg</span>::<span style="color:#036; font-weight:bold">Ferret</span>::<span style="color:#036; font-weight:bold">Analyzer</span>.new { |tokenizer|
1113
+ <span style="color:#036; font-weight:bold">Ferret</span>::<span style="color:#036; font-weight:bold">Analysis</span>::<span style="color:#036; font-weight:bold">LowerCaseFilter</span>.new(tokenizer)
1114
+ }
1115
+ index = <span style="color:#036; font-weight:bold">Ferret</span>::<span style="color:#036; font-weight:bold">Index</span>::<span style="color:#036; font-weight:bold">Index</span>.new(<span style="color:#A60">:analyzer</span> =&gt; analyzer)
1116
+ </pre><br />
1117
+ <br />
1118
+ A complete example can be found in <tt>misc/ferret_example.rb</tt>. The result<br />
1119
+ of running that example is shown in <a class="xref" href="#Ferret-Example-Screenshot">Figure 1. Ferret Example Screenshot</a>.<br />
1120
+ <br />
1121
+ <div class="figure">
1122
+ <p class="title"><a class="list" id="Ferret-Example-Screenshot" href="#a-605925108">Figure 1</a>.&nbsp;&nbsp;<a class="here" href="#Ferret-Example-Screenshot">Ferret Example Screenshot</a></p>
1123
+ <div class="content"><img src="http://pluskid.lifegoo.com/wp-content/uploads/2008/02/rmmseg.png" alt="" /></div>
1124
+ </div></p></div>
1125
+ </div><br />
1126
+ <div class="section">
1127
+ <h3 class="title">
1128
+ <a class="list" id="Normal-Ruby-program" href="#a-605931938">3.2.3</a>&nbsp;&nbsp;<a class="here" href="#Normal-Ruby-program">Normal Ruby program</a>
1129
+ </h3>
1130
+ <div class="content"><p>rmmseg-cpp can also be used in normal Ruby programs. Just create<br />
1131
+ an <code class="code"><span style="color:#036; font-weight:bold">Algorithm</span></code> object and call <code class="code">next_token</code> until a <code class="code"><span style="color:#038; font-weight:bold">nil</span></code> is returned:</p>
1132
+ <pre class="code">
1133
+ algor = <span style="color:#036; font-weight:bold">RMMSeg</span>::<span style="color:#036; font-weight:bold">Algorithm</span>.new(text)
1134
+ loop <span style="color:#080; font-weight:bold">do</span>
1135
+ tok = algor.next_token
1136
+ <span style="color:#080; font-weight:bold">break</span> <span style="color:#080; font-weight:bold">if</span> tok.nil?
1137
+ puts <span style="background-color:#fff0f0"><span style="color:#710">&quot;</span><span style="background: #eee"><span style="font-weight: bold; color: #888">#{</span>tok.text<span style="font-weight: bold; color: #888">}</span></span><span style="color:#D20"> [</span><span style="background: #eee"><span style="font-weight: bold; color: #888">#{</span>tok.start<span style="font-weight: bold; color: #888">}</span></span><span style="color:#D20">..</span><span style="background: #eee"><span style="font-weight: bold; color: #888">#{</span>tok.end<span style="font-weight: bold; color: #888">}</span></span><span style="color:#D20">]</span><span style="color:#710">&quot;</span></span>
1138
+ <span style="color:#080; font-weight:bold">end</span>
1139
+ </pre></div>
1140
+ </div></div>
1141
+ </div></div>
1142
+ </div>
1143
+ <div class="chapter">
1144
+ <h1 class="title">
1145
+ Chapter
1146
+ <a class="list" id="Who-use-it" href="#a-605957278">4</a>
1147
+
1148
+ <br/>
1149
+
1150
+ <a class="here" href="#Who-use-it"><big>Who use it</big></a>
1151
+ </h1>
1152
+
1153
+ <div class="content"><p><div class="tip">
1154
+ <p class="title"><a class="list" id="Expand-this-list" href="#a-605970528">Tip 1</a>.&nbsp;&nbsp;<a class="here" href="#Expand-this-list">Expand this list</a></p>
1155
+
1156
+ <div class="content icon-tip">If you used rmmseg-cpp and would like your project to<br />
1157
+ appear in this list, please <a href="mailto:pluskid@gmail.com">contact me</a>.</div>
1158
+ </div></p>
1159
+ <ul>
1160
+ <li><a href="http://www.javaeye.com/">JavaEye</a>: One of the biggest software developper<br />
1161
+ community in China.</li>
1162
+ </ul></div>
1163
+ </div>
1164
+ <div class="chapter">
1165
+ <h1 class="title">
1166
+ Chapter
1167
+ <a class="list" id="Resources" href="#a-605989058">5</a>
1168
+
1169
+ <br/>
1170
+
1171
+ <a class="here" href="#Resources"><big>Resources</big></a>
1172
+ </h1>
1173
+
1174
+ <div class="content"><ul>
1175
+ <li><a href="http://rubyforge.org/projects/rmmseg-cpp/">Project Home</a>: The Project page at RubyForge.</li>
1176
+ <li><a href="http://rmmseg-cpp.rubyforge.org/rdoc/index.html">RDoc of rmmseg-cpp</a>: The auto generated rdoc of RMMSeg.</li>
1177
+ <li><a href="http://pluskid.lifegoo.com/">Free Mind</a>: The author&#8217;s blog.</li>
1178
+ <li><a href="mailto:pluskid@gmail.com">Author&#8217;s Email</a>: Contact me if you have any problem.</li>
1179
+ </ul></div>
1180
+ </div></div>
1181
+
1182
+
1183
+ <br style="display: none"/>
1184
+ <hr style="display: none"/>
1185
+ <br style="display: none"/>
1186
+
1187
+
1188
+ <div id="footer">
1189
+
1190
+ Generated on Thu Aug 14 12:26:56 -0400 2008 by <a href="http://gerbil.rubyforge.org">Gerbil</a> 3.1.0.
1191
+
1192
+ <div id="footer-credits">
1193
+ <span class="icon-warning" style="float: right">&nbsp;</span>
1194
+ <span class="icon-tip" style="float: right">&nbsp;</span>
1195
+
1196
+ <p>The admonition graphics used in this document are Copyright &copy; 2005 <a href="http://tango.freedesktop.org">Tango Desktop Project</a>. They are part of the <a href="http://tango.freedesktop.org/Tango_Icon_Library">Tango Icon Theme</a> set, which is distributed under the <a href="http://creativecommons.org/licenses/by-sa/2.5/">Creative Commons Attribution-ShareAlike 2.5 License Agreement</a>.</p>
1197
+ </div>
1198
+
1199
+ </div>
1200
+
1201
+ </body>
1202
+ </html>