<commit_before>package org.gbif.occurrence.ws.client.mock;

import org.gbif.api.model.common.search.SearchResponse;
import org.gbif.api.model.occurrence.Occurrence;
import org.gbif.api.model.occurrence.search.OccurrenceSearchParameter;
import org.gbif.api.model.occurrence.search.OccurrenceSearchRequest;
import org.gbif.api.service.occurrence.OccurrenceSearchService;
import org.gbif.api.service.occurrence.OccurrenceService;

import java.util.List;

import javax.annotation.Nullable;

import com.google.common.collect.ImmutableList;
import com.google.common.collect.Lists;
import com.google.inject.Inject;

/**
 * Mock service of {@link OccurrenceSearchService}.
 */
public class OccurrenceSearchMockService implements OccurrenceSearchService {

  @Inject
  private OccurrenceService occurrenceService;

  private static final int NUM_RESULTS = 20;

  @Override
  public SearchResponse<Occurrence, OccurrenceSearchParameter> search(OccurrenceSearchRequest request) {
    List<Occurrence> results = Lists.newArrayList();
    for (int i = 0; i < NUM_RESULTS; i++) {
      results.add(occurrenceService.get(i));
    }
    SearchResponse<Occurrence, OccurrenceSearchParameter> response =
      new SearchResponse<Occurrence, OccurrenceSearchParameter>(0L, NUM_RESULTS, new Long(NUM_RESULTS), results, null);
    response.setResults(results);
    return response;
  }

  @Override
  public List<String> suggestCatalogNumbers(String prefix, @Nullable Integer limit) {
    return new ImmutableList.Builder<String>().add("11").add("22").add("33").build();
  }

  @Override
  public List<String> suggestCollectionCodes(String prefix, @Nullable Integer limit) {
    return new ImmutableList.Builder<String>().add("EBIRD").add("SG").add("PFW").build();
  }

  @Override
  public List<String> suggestRecordedBy(String prefix, @Nullable Integer limit) {
    return new ImmutableList.Builder<String>().add("collector1").add("collector2").add("collector3").build();
  }

  @Override
  public List<String> suggestRecordNumbers(String prefix, @Nullable Integer limit) {
    return new ImmutableList.Builder<String>().add("r1").add("r2").add("r3").build();
  }

  @Override
  public List<String> suggestInstitutionCodes(String prefix, @Nullable Integer limit) {
    return new ImmutableList.Builder<String>().add("AUDCLO").add("GBIF-SE:ArtDatabanken SG").add("CLO").build();
  }

  @Override
  public List<String> suggestOccurrenceIds(String prefix, @Nullable Integer limit) {
    return new ImmutableList.Builder<String>().add("id1").add("id2").add("id3").build();
  }

}<commit_msg>adding new auto-suggest methods for: organismId, locality, stateProvince and waterBody<commit_after>package org.gbif.occurrence.ws.client.mock;

import org.gbif.api.model.common.search.SearchResponse;
import org.gbif.api.model.occurrence.Occurrence;
import org.gbif.api.model.occurrence.search.OccurrenceSearchParameter;
import org.gbif.api.model.occurrence.search.OccurrenceSearchRequest;
import org.gbif.api.service.occurrence.OccurrenceSearchService;
import org.gbif.api.service.occurrence.OccurrenceService;

import java.util.List;

import javax.annotation.Nullable;
import javax.validation.constraints.Min;

import com.google.common.collect.ImmutableList;
import com.google.common.collect.Lists;
import com.google.inject.Inject;

/**
 * Mock service of {@link OccurrenceSearchService}.
 */
public class OccurrenceSearchMockService implements OccurrenceSearchService {

  @Inject
  private OccurrenceService occurrenceService;

  private static final int NUM_RESULTS = 20;

  @Override
  public SearchResponse<Occurrence, OccurrenceSearchParameter> search(OccurrenceSearchRequest request) {
    List<Occurrence> results = Lists.newArrayList();
    for (int i = 0; i < NUM_RESULTS; i++) {
      results.add(occurrenceService.get(i));
    }
    SearchResponse<Occurrence, OccurrenceSearchParameter> response =
      new SearchResponse<Occurrence, OccurrenceSearchParameter>(0L, NUM_RESULTS, new Long(NUM_RESULTS), results, null);
    response.setResults(results);
    return response;
  }

  @Override
  public List<String> suggestCatalogNumbers(String prefix, @Nullable Integer limit) {
    return new ImmutableList.Builder<String>().add("11").add("22").add("33").build();
  }

  @Override
  public List<String> suggestCollectionCodes(String prefix, @Nullable Integer limit) {
    return new ImmutableList.Builder<String>().add("EBIRD").add("SG").add("PFW").build();
  }

  @Override
  public List<String> suggestRecordedBy(String prefix, @Nullable Integer limit) {
    return new ImmutableList.Builder<String>().add("collector1").add("collector2").add("collector3").build();
  }

  @Override
  public List<String> suggestRecordNumbers(String prefix, @Nullable Integer limit) {
    return new ImmutableList.Builder<String>().add("r1").add("r2").add("r3").build();
  }

  @Override
  public List<String> suggestInstitutionCodes(String prefix, @Nullable Integer limit) {
    return new ImmutableList.Builder<String>().add("AUDCLO").add("GBIF-SE:ArtDatabanken SG").add("CLO").build();
  }

  @Override
  public List<String> suggestOccurrenceIds(String prefix, @Nullable Integer limit) {
    return new ImmutableList.Builder<String>().add("id1").add("id2").add("id3").build();
  }

  @Override
  public List<String> suggestOrganismIds(String prefix, @Nullable Integer limit) {
    return new ImmutableList.Builder<String>().add("id1").add("id2").add("id3").build();
  }

  @Override
  public List<String> suggestLocalities(String prefix, @Nullable Integer limit) {
    return new ImmutableList.Builder<String>().add("Florida").add("San Jorge").add("Panama Canal").build();
  }

  @Override
  public List<String> suggestWaterBodies(String prefix, @Nullable Integer limit) {
    return new ImmutableList.Builder<String>().add("Pacific Ocean").add("Atlantic Ocean").build();
  }

  @Override
  public List<String> suggestStateProvinces(String prefix, @Nullable Integer limit) {
    return new ImmutableList.Builder<String>().add("Florida").add("New York").add("Texas").build();
  }
}
{'fraction_non_alphanumeric': 0.13378534810649909, 'fraction_numerical': 0.006780221597486357, 'mean_word_length': 5.712541620421754, 'pattern_counts': {'":': 0, '<': 45, '<?xml version=': 0, '>': 43, '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': '4269704', 'n_tokens_mistral': 1869, 'n_tokens_neox': 1793, 'n_words': 344}