[Prime-cvs] CVS update: prime/lib

Back to archive index

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


Index: prime/lib/prime2.rb
diff -u prime/lib/prime2.rb:1.1.2.17 prime/lib/prime2.rb:1.1.2.18
--- prime/lib/prime2.rb:1.1.2.17	Wed Mar  2 02:34:55 2005
+++ prime/lib/prime2.rb	Tue Mar  8 20:48:54 2005
@@ -1,5 +1,5 @@
 # prime2.rb: Module for PRIME2 protocol.
-# $Id: prime2.rb,v 1.1.2.17 2005/03/01 17:34:55 komatsu Exp $
+# $Id: prime2.rb,v 1.1.2.18 2005/03/08 11:48:54 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.1.2.4 prime/lib/session-japanese.rb:1.1.2.5
--- prime/lib/session-japanese.rb:1.1.2.4	Thu Mar  3 10:13:28 2005
+++ prime/lib/session-japanese.rb	Tue Mar  8 20:48:54 2005
@@ -1,5 +1,5 @@
 # session-japanese.rb: Session library for Japanese.
-# $Id: session-japanese.rb,v 1.1.2.4 2005/03/03 01:13:28 komatsu Exp $
+# $Id: session-japanese.rb,v 1.1.2.5 2005/03/08 11:48:54 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