public static void writeRuleToFile(ArrayList<String> text) throws IOException {
        Path rule = new Path("C45/rule.txt");
        Configuration conf = new Configuration();
        FileSystem fs = FileSystem.get(conf);
        try {
            BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(fs.create(rule, true)));
            for (String str : text) {
                bw.write(str);
            }
            bw.newLine();
            bw.close();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }