
function model_out = lines_to_vectors(model)


    num_lines = length(model.lines_est1);
    
    % num_words_est = size(model.hashmap_est);
    % num_words_eng = size(model.hashmap_eng);
    num_words_est = model.hashmap_size_est;
    num_words_eng = model.hashmap_size_eng;
    
    model.vectors_est = zeros(num_words_est, 0); % zeros(num_words_est, num_lines); 
    model.vectors_eng = zeros(num_words_eng, 0); % zeros(num_words_eng, num_lines);
    
    model.registered_vectors_est = java.util.Properties;
    model.registered_vectors_eng = java.util.Properties;
    
    model.vector_nr_to_line_nr = java.util.Properties;
    model.line_nr_to_vector_nr = java.util.Properties;
    
    
    lines_est = model.lines_est1; % {1};
    lines_eng = model.lines_eng1; % {1};
    
    vectors_i = 1;
    for i = 1:num_lines
        
        line_est = lines_est(i);
        line_eng = lines_eng(i);
        
        vector_est = line_to_vector(model.hashmap_est, line_est{1}, num_words_est);
        vector_eng = line_to_vector(model.hashmap_eng, line_eng{1}, num_words_eng);
    
        
        [est_registered, first_est_vectors_i] = vector_registered(model, vector_est, 'est');
        
        if ~est_registered && ~vector_registered(model, vector_eng, 'eng')   % skip duplicate vectors
            
            model.vectors_est(:, vectors_i) = vector_est;
            model.vectors_eng(:, vectors_i) = vector_eng;
            
            model = register_vector(model, vector_est, 'est', vectors_i);
            model = register_vector(model, vector_eng, 'eng', vectors_i);
            
            model.vector_nr_to_line_nr.put(vectors_i, i);
            model.line_nr_to_vector_nr.put(i, vectors_i);
            
            
            vectors_i = vectors_i + 1;
            
        else      % if ~vector_registered(model, vector_est) && ~vector_registered(model, vector_eng)   % skip duplicate vectors
             
            % first_vectors_i = model.registered_vectors_est.get(i);
            model.line_nr_to_vector_nr.put(i, first_est_vectors_i);
            
        end      % if ~vector_registered(model, vector_est) && ~vector_registered(model, vector_eng)   % skip duplicate vectors
        
        
    end     % for i = 1:num_lines
    
    
    model_out = model;

end
