<commit_before>
package oci.gocic;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.util.Vector;

import org.json.simple.JSONObject;
import org.json.simple.parser.JSONParser;

/**
 * Object class of the GOCIC configuration file which contains the parsed configuration information.
 * @author <NAME>
 */
public class GocicConfig {

    private File    configFile  = null;
    private Vector  locics      = new Vector<Locic>();
    private Vector  gocics      = new Vector<Locic>();
    
    public GocicConfig(File configFile) {
        this.configFile = configFile;
    }
    
    public boolean parseConfig() {
        if(configFile == null) return false;
        
        try {
            FileReader  fileReader  = new FileReader(this.configFile);
            JSONParser  parser      = new JSONParser();
            JSONObject  object      = (JSONObject) parser.parse(fileReader);
            
            String      ip          = (String) object.get("ip");
            
        } catch (Exception e) {
            e.printStackTrace();
            return false;
        }
        
        return true;
    }
    
    public boolean parseConfig(File configFile) {
        this.configFile = configFile;
        return this.parseConfig();
    }
    
    public Vector<Locic> getLocics() {
        return locics;
    }
    
} // class<commit_msg>started implementing the config parser<commit_after>
package oci.gocic;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.net.InetAddress;
import java.util.Vector;

import org.json.simple.JSONArray;
import org.json.simple.JSONObject;
import org.json.simple.parser.JSONParser;

/**
 * Object class of the GOCIC configuration file which contains the parsed configuration information.
 * @author <NAME>
 */
public class GocicConfig {

    private File    configFile  = null;
    private Vector  locics      = new Vector<Locic>();
    private Vector  gocics      = new Vector<Locic>();
    
    public GocicConfig(File configFile) {
        this.configFile = configFile;
    }
    
    public boolean parseConfig() {
        if(configFile == null) return false;
        
        try {
            FileReader  fileReader  = new FileReader(this.configFile);
            JSONParser  parser      = new JSONParser();
            
            JSONArray   array       = (JSONArray) parser.parse(fileReader);
            
            JSONObject  object      = null;
            String      ip          = null;
            String      subnet      = null;
            String      location    = null;
            
            for(int i = 0; i<array.size(); i++) {
                // better use iterator?
                
                object      = (JSONObject) array.get(i);
                        
                ip          = (String) object.get("ip");        
                subnet      = (String) object.get("subnet");      
                location    = (String) object.get("location");
                
                this.locics.addElement(new Locic(InetAddress.getByName(ip), subnet, location));
                
            }

        } catch (Exception e) {
            e.printStackTrace();
            return false;
        }
        
        return true;
    }
    
    public boolean parseConfig(File configFile) {
        this.configFile = configFile;
        return this.parseConfig();
    }
    
    public Vector<Locic> getLocics() {
        return this.locics;
    }
    
} // class
{'fraction_non_alphanumeric': 0.090754877014419, 'fraction_numerical': 0.0002827254735651682, 'mean_word_length': 1.7236335642802156, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2015046', 'n_tokens_mistral': 951, 'n_tokens_neox': 939, 'n_words': 235}