<commit_before>package core;

import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import util.*;

/**
 * core.Matcher class.
 */
public class Matcher {

    /**
     * List of entities of type A.
     */
    private ArrayList<Entity> aEntity;

    /**
     * List of entities of type B.
     */
    private ArrayList<Entity> bEntity;

    /**
     * List of constraints.
     */
    private Constraint constraints;


    public Matcher(final ArrayList<Entity> aEntity,
                   final ArrayList<Entity> bEntity,
                   final ArrayList<Constraint> constraints) {
        this.aEntity = aEntity;
        this.bEntity = bEntity;
        this.constraints = constraints.get(Constants.CONSTRAINTS_INDEX);
    }

    /**
     * Phase One for generating matching candidates for given Entity.
     * In this phase, the entities are filtered by the mandatory attributes
     * @param aTypeEntity entity to match
     */
    public ArrayList<Entity> generatesCandidatesPhaseOne(Entity aTypeEntity) throws IOException {
        ArrayList<Entity> candidates = new ArrayList<>();<commit_msg>added TODOs for the second phase of candidates generator<commit_after>package core;

import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import util.*;

/**
 * core.Matcher class.
 */
public class Matcher {

    /**
     * List of entities of type A.
     */
    private ArrayList<Entity> aEntity;

    /**
     * List of entities of type B.
     */
    private ArrayList<Entity> bEntity;

    /**
     * List of constraints.
     */
    private Constraint constraints;


    public Matcher(final ArrayList<Entity> aEntity,
                   final ArrayList<Entity> bEntity,
                   final ArrayList<Constraint> constraints) {
        this.aEntity = aEntity;
        this.bEntity = bEntity;
        this.constraints = constraints.get(Constants.CONSTRAINTS_INDEX);
    }

    /**
     * Phase Two of generating matching candidates for given Entity.
     * In this phase, the entities are filtered by the soft attributes
     * @param aTypeEntity entity to match
     * @return
     */
    public ArrayList<Entity> generatesCandidatesPhaseTwo(Entity aTypeEntity) {
        //TODO take the sorted list of elements of type A (sorted based on Score criteria)
        //TODO check if there is minimum one candidate. If not, then return an empty list + a message
        //TODO check if there are more than one candidate
        //TODO begin applying the soft constraints and reducing the number of candidates
        //TODO pick the
        return null;
    }

    /**
     * Phase One of generating matching candidates for given Entity.
     * In this phase, the entities are filtered by the mandatory attributes
     * @param aTypeEntity entity to match
     */
    public ArrayList<Entity> generatesCandidatesPhaseOne(Entity aTypeEntity) throws IOException {
        ArrayList<Entity> candidates = new ArrayList<>();
{'fraction_non_alphanumeric': 0.0801475519785379, 'fraction_numerical': 0.0, 'mean_word_length': 2.593975903614458, 'pattern_counts': {'":': 0, '<': 20, '<?xml version=': 0, '>': 20, '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': '3910476', 'n_tokens_mistral': 759, 'n_tokens_neox': 738, 'n_words': 275}