Commits

Mike Speriosu  committed b4e6d12

Updated WikiRelFreqs.scala.

  • Participants
  • Parent commits f72ddd7

Comments (0)

Files changed (1)

File src/main/scala/opennlp/textgrounder/util/WikiRelFreqs.scala

     val lines = scala.io.Source.fromFile(filename).getLines
     val freqs = new scala.collection.mutable.HashMap[String, Float]
     var total = 0
+    var lineCount = 0
 
     for(line <- lines) {
       if(wordCountRE.findFirstIn(line) != None) {
         freqs.put(lowerWord, oldCount + count.toFloat)
         total += count.toInt
       }
+      if(lineCount % 10000000 == 0)
+        println(filename+" "+lineCount)
+      lineCount += 1
     }
 
     freqs.map(p => (p._1, p._2 / total)).toMap