[Prime-cvs] CVS update: prime/lib

Back to archive index

Hiroyuki Komatsu komat****@users*****
2005年 3月 8日 (火) 20:50:40 JST


Index: prime/lib/prime2.rb
diff -u prime/lib/prime2.rb:1.2 prime/lib/prime2.rb:1.2.2.1
--- prime/lib/prime2.rb:1.2	Mon Mar  7 16:51:32 2005
+++ prime/lib/prime2.rb	Tue Mar  8 20:50:39 2005
@@ -1,5 +1,5 @@
 # prime2.rb: Module for PRIME2 protocol.
-# $Id: prime2.rb,v 1.2 2005/03/07 07:51:32 komatsu Exp $
+# $Id: prime2.rb,v 1.2.2.1 2005/03/08 11:50:39 komatsu Exp $
 #
 # Copyright (C) 2004 Hiroyuki Komatsu <komat****@taiya*****>
 #     All rights reserved.
@@ -148,6 +148,14 @@
     @score    = score
   end
 
+  def <=> ( other )
+    case other
+    when PrimeConversion then
+      return @score <=> other.score
+    end
+    return nil
+  end
+
   def dup ()
     return PrimeConversion.new(@segments.dup, @score, @position)
   end
Index: prime/lib/session-japanese.rb
diff -u prime/lib/session-japanese.rb:1.2 prime/lib/session-japanese.rb:1.2.2.1
--- prime/lib/session-japanese.rb:1.2	Mon Mar  7 16:51:32 2005
+++ prime/lib/session-japanese.rb	Tue Mar  8 20:50:39 2005
@@ -1,5 +1,5 @@
 # session-japanese.rb: Session library for Japanese.
-# $Id: session-japanese.rb,v 1.2 2005/03/07 07:51:32 komatsu Exp $
+# $Id: session-japanese.rb,v 1.2.2.1 2005/03/08 11:50:39 komatsu Exp $
 #
 # Copyright (C) 2005 Hiroyuki Komatsu <komat****@taiya*****>
 #     All rights reserved.
@@ -329,7 +329,8 @@
     ## If the result of convert_japanese_uniclause exists and the score of it
     ## is greater than the result of convert_prefix, the return conversion
     ## becomes the convert_japanese_uniclause's one.
-    conversion_japanese = convert_japanese_uniclause().first()
+    conversion_japanese = convert_japanese_uniclause().max()
+
     if conversion_japanese.nil?() then
       conversion = conversion_prefix
     elsif conversion_japanese.score < conversion_prefix.score then


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