Revision: 17538
          http://sourceforge.net/p/gate/code/17538
Author:   adamfunk
Date:     2014-03-04 21:48:49 +0000 (Tue, 04 Mar 2014)
Log Message:
-----------
Sensible names for IDFs

Modified Paths:
--------------
    gate/trunk/plugins/TermRaider/src/gate/termraider/bank/TfIdfTermbank.java
    gate/trunk/plugins/TermRaider/src/gate/termraider/modes/IdfCalculation.java

Modified: 
gate/trunk/plugins/TermRaider/src/gate/termraider/bank/TfIdfTermbank.java
===================================================================
--- gate/trunk/plugins/TermRaider/src/gate/termraider/bank/TfIdfTermbank.java   
2014-03-04 21:00:13 UTC (rev 17537)
+++ gate/trunk/plugins/TermRaider/src/gate/termraider/bank/TfIdfTermbank.java   
2014-03-04 21:48:49 UTC (rev 17538)
@@ -141,7 +141,7 @@
 
           
   @CreoleParameter(comment = "inverted document frequency calculation",
-          defaultValue = "Logarithmic")
+          defaultValue = "LogarithmicScaled")
   public void setIdfCalculation(IdfCalculation mode) {
     this.idfCalculation = mode;
   }

Modified: 
gate/trunk/plugins/TermRaider/src/gate/termraider/modes/IdfCalculation.java
===================================================================
--- gate/trunk/plugins/TermRaider/src/gate/termraider/modes/IdfCalculation.java 
2014-03-04 21:00:13 UTC (rev 17537)
+++ gate/trunk/plugins/TermRaider/src/gate/termraider/modes/IdfCalculation.java 
2014-03-04 21:48:49 UTC (rev 17538)
@@ -15,6 +15,7 @@
 
 public enum IdfCalculation {
   Logarithmic,
+  LogarithmicScaled,
   Scaled,
   Natural;
   
@@ -26,10 +27,14 @@
     double df = (double) rawDF;
     double n = (double) corpusSize;
     
-    if (mode == Logarithmic) {
+    if (mode == LogarithmicScaled) {
       return 1.0 + Utilities.log2(n / (df + 1.0));
     }
 
+    if (mode == Logarithmic) {
+      return 1.0 + Utilities.log2(1.0 / (df + 1.0));
+    }
+
     if (mode == Scaled) {
       return (1.0 + n )/ (df + 1.0);
     }

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Subversion Kills Productivity. Get off Subversion & Make the Move to Perforce.
With Perforce, you get hassle-free workflows. Merge that actually works. 
Faster operations. Version large binaries.  Built-in WAN optimization and the
freedom to use Git, Perforce or both. Make the move to Perforce.
http://pubads.g.doubleclick.net/gampad/clk?id=122218951&iu=/4140/ostg.clktrk
_______________________________________________
GATE-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gate-cvs

Reply via email to