<commit_before>package gov.nih.nci.ncicb.cadsr.loader.ext;

import gov.nih.nci.cadsr.freestylesearch.util.*;

import javax.sql.DataSource;
import java.util.*;

// import gov.nih.nci.ncicb.cadsr.domain.*;

// import org.springframework.beans.factory.BeanFactory;
// import org.springframework.beans.factory.xml.XmlBeanFactory;
// import org.springframework.core.io.InputStreamResource;

import java.sql.*;


public class FreestyleModule {

  Search search = new Search();

  public List<gov.nih.nci.ncicb.cadsr.domain.DataElement> findDataElements(String searchString) {
    search.restrictResultsByType(SearchAC.DE);
    Vector<gov.nih.nci.cadsr.domain.AdministeredComponent> acResult = search.findReturningAdministeredComponent(searchString);
    
    List<gov.nih.nci.cadsr.domain.DataElement> result = new ArrayList<gov.nih.nci.cadsr.domain.DataElement>();
    for(gov.nih.nci.cadsr.domain.AdministeredComponent ac : acResult)
      result.add((gov.nih.nci.cadsr.domain.DataElement)ac);

    return new ArrayList(CadsrTransformer.deListPublicToPrivate(result));
  }


  public void setDatasource(DataSource ds) {
    search.setDataDescription(ds);
  }

}<commit_msg>Added new function to return SearchResults.<commit_after>package gov.nih.nci.ncicb.cadsr.loader.ext;

import gov.nih.nci.cadsr.freestylesearch.util.*;

import javax.sql.DataSource;
import java.util.*;

// import gov.nih.nci.ncicb.cadsr.domain.*;

// import org.springframework.beans.factory.BeanFactory;
// import org.springframework.beans.factory.xml.XmlBeanFactory;
// import org.springframework.core.io.InputStreamResource;

import java.sql.*;


public class FreestyleModule {

  Search search = new Search();

  public List<gov.nih.nci.ncicb.cadsr.domain.DataElement> findDataElements(String searchString) {
    search.restrictResultsByType(SearchAC.DE);
    Vector<gov.nih.nci.cadsr.domain.AdministeredComponent> acResult = search.findReturningAdministeredComponent(searchString);
    
    List<gov.nih.nci.cadsr.domain.DataElement> result = new ArrayList<gov.nih.nci.cadsr.domain.DataElement>();
    for(gov.nih.nci.cadsr.domain.AdministeredComponent ac : acResult)
      result.add((gov.nih.nci.cadsr.domain.DataElement)ac);

    return new ArrayList(CadsrTransformer.deListPublicToPrivate(result));
  }
  
  public List<SearchResults> findSearchResults(String searchString) 
  {
    search.restrictResultsByType(SearchAC.DE);
    Vector<SearchResults> srResult = search.findReturningSearchResults(searchString);
    
    return srResult;
  }


  public void setDatasource(DataSource ds) {
    search.setDataDescription(ds);
  }

}
{'fraction_non_alphanumeric': 0.12044495588799387, 'fraction_numerical': 0.0, 'mean_word_length': 4.744493392070485, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '3869933', 'n_tokens_mistral': 868, 'n_tokens_neox': 845, 'n_words': 113}