lewismc commented on a change in pull request #31: SDAP-118 create a new
ranking module
URL:
https://github.com/apache/incubator-sdap-mudrod/pull/31#discussion_r199279464
##########
File path:
ranking/src/main/java/org/apache/sdap/mudrod/ranking/ranksvm/SparkFormatter.java
##########
@@ -0,0 +1,55 @@
+package org.apache.sdap.mudrod.ranking.ranksvm;
+
+import java.io.*;
+import java.text.DecimalFormat;
+
+public class SparkFormatter {
+ DecimalFormat NDForm = new DecimalFormat("#.###");
+
+ public SparkFormatter() {
+ }
+
+ public void toSparkSVMformat(String inputCSVFileName, String
outputTXTFileName) {
+ File file = new File(outputTXTFileName);
+ if (file.exists()) {
+ file.delete();
+ }
+ try {
+ file.createNewFile();
+ FileWriter fw = new FileWriter(outputTXTFileName);
+ BufferedWriter bw = new BufferedWriter(fw);
+
+ BufferedReader br = new BufferedReader(new FileReader(inputCSVFileName));
Review comment:
Can ```br``` and ```bw``` cannot be used as a try-with-resources ?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services