[Prime-cvs] CVS update: prime/lib

Back to archive index

Hiroyuki Komatsu komat****@users*****
2005年 3月 28日 (月) 00:23:09 JST


Index: prime/lib/protocol.rb
diff -u prime/lib/protocol.rb:1.3 prime/lib/protocol.rb:1.4
--- prime/lib/protocol.rb:1.3	Thu Mar 17 21:01:57 2005
+++ prime/lib/protocol.rb	Mon Mar 28 00:23:09 2005
@@ -1,5 +1,5 @@
 # protocol.rb
-# $Id: protocol.rb,v 1.3 2005/03/17 12:01:57 komatsu Exp $
+# $Id: protocol.rb,v 1.4 2005/03/27 15:23:09 komatsu Exp $
 #
 # Copyright (C) 2005 Hiroyuki Komatsu <komat****@taiya*****>
 #     All rights reserved.
@@ -538,12 +538,26 @@
 
 # ----
 
-class PrimeProtocolSKK < PrimeProtocolCore
-  def initialize (prime, portnum)
-    super(prime)
-    @portnum = portnum
+class PrimeProtocolMigemo < PrimeProtocolCore
+  def execute ( line )
+    if line.nil? then
+      return false
+    end
+
+    line.chomp!()
+    words =****@prime*****_prefix(line)
+
+    return migemo_format( words ) + "\n"
+  end
+
+  def migemo_format ( words )
+    return words.map { | word |
+      word.to_text_literal()
+    }.join( "\\|" )
   end
+end
 
+class PrimeProtocolSKK < PrimeProtocolCore
   def get_line (io_in)
     line = ""
     loop {


Prime-cvs メーリングリストの案内
Back to archive index