<commit_before>package net.atomcode.bearing;

import android.content.Context;
import android.location.LocationManager;

import net.atomcode.bearing.geocoding.GeocodingTask;
import net.atomcode.bearing.geocoding.GeocodingTaskListener;
import net.atomcode.bearing.geocoding.ReverseGeocodingTask;
import net.atomcode.bearing.location.Accuracy;
import net.atomcode.bearing.location.CurrentLocationListener;
import net.atomcode.bearing.location.CurrentLocationTask;

/**
 * Entry class for Bearing library. Has functions for all major actions
 */
public class Bearing
{
	/**
	 * Geocode query into latitude and longitude
	 * @param context The context of the request
	 * @param query The string queried
	 * @param listener The listener to call back to
	 */
	public static GeocodingTask getAddressListForQuery(Context context, String query, GeocodingTaskListener listener)
	{
		GeocodingTask geocodingTask = new GeocodingTask(context);
		geocodingTask.setGeocodingTaskListener(listener);
		geocodingTask.execute(query);

		return geocodingTask;
	}

	/**
	 * Reverse geocode the location into an address
	 * @param context The context of the request
	 * @param latitude The latitude to lookup
	 * @param longitude The longitude to check
	 * @param listener The listener to call back to
	 */
	public static ReverseGeocodingTask getAddressListForLocation(Context context, Double latitude, Double longitude, GeocodingTaskListener listener)
	{
		ReverseGeocodingTask geocodingTask = new ReverseGeocodingTask(context);
		geocodingTask.setGeocodingTaskListener(listener);
		geocodingTask.execute(latitude, longitude);

		return geocodingTask;
	}

	/**
	 * Get the current location of the user to the given accuracy
	 * @param context The context of the request
	 * @param accuracy The accuracy to which the users location should match.
	 * @param listener The listener to call back to
	 */
	public static CurrentLocationTask getCurrentLocation(Context context, Accuracy accuracy, CurrentLocationListener listener)
	{
		CurrentLocationTask currentLocationTask = new CurrentLocationTask(context);
		currentLocationTask.setCurrentLocationListener(listener);
		currentLocationTask.execute(accuracy);

		return currentLocationTask;
	}

	/**
	 * Get the current location of the user to the closest 50 metres.
	 * @param context The context of the request
	 * @param listener The listener to call back to
	 */<commit_msg>Added extra methods for address lookup to allow for configurable result count.<commit_after>package net.atomcode.bearing;

import android.content.Context;
import android.location.LocationManager;

import net.atomcode.bearing.geocoding.GeocodingTask;
import net.atomcode.bearing.geocoding.GeocodingTaskListener;
import net.atomcode.bearing.geocoding.ReverseGeocodingTask;
import net.atomcode.bearing.location.Accuracy;
import net.atomcode.bearing.location.CurrentLocationListener;
import net.atomcode.bearing.location.CurrentLocationTask;

/**
 * Entry class for Bearing library. Has functions for all major actions
 */
public class Bearing
{
	/**
	 * Geocode query into latitude and longitude into a single, best-guess Address.
	 * @param context The context of the request
	 * @param query The string queried
	 * @param listener The listener to call back to
	 */
	public static GeocodingTask getAddressForQuery(Context context, String query, GeocodingTaskListener listener)
	{
		return getAddressListForQuery(context, query, listener, 1);
	}

	/**
	 * Geocode query into latitude and longitude.
	 *
	 * This request returns a list of 10 results by default. For configurable values see
	 * {@link net.atomcode.bearing.Bearing#getAddressListForQuery(android.content.Context, String, net.atomcode.bearing.geocoding.GeocodingTaskListener, int)}
	 *
	 * @param context The context of the request
	 * @param query The string queried
	 * @param listener The listener to call back to
	 */
	public static GeocodingTask getAddressListForQuery(Context context, String query, GeocodingTaskListener listener)
	{
		return getAddressListForQuery(context, query, listener, 10);
	}

	/**
	 * Geocode query into latitude and longitude
	 * @param context The context of the request
	 * @param query The string queried
	 * @param listener The listener to call back to
	 */
	public static GeocodingTask getAddressListForQuery(Context context, String query, GeocodingTaskListener listener, int resultCount)
	{
		GeocodingTask geocodingTask = new GeocodingTask(context);
		geocodingTask.setGeocodingTaskListener(listener);
		geocodingTask.setResultCount(resultCount);
		geocodingTask.execute(query);

		return geocodingTask;
	}

	/**
	 * Reverse geocode the location into an address. This method returns a single, best-guess location for the query.
	 * @param context The context of the request
	 * @param latitude The latitude to lookup
	 * @param longitude The longitude to check
	 * @param listener The listener to call back to
	 */
	public static ReverseGeocodingTask getAddressForLocation(Context context, Double latitude, Double longitude, GeocodingTaskListener listener)
	{
		return getAddressListForLocation(context, latitude, longitude, listener, 1);
	}

	/**
	 * Reverse geocode the location into an address. This method returns a list of default length 10.
	 * @param context The context of the request
	 * @param latitude The latitude to lookup
	 * @param longitude The longitude to check
	 * @param listener The listener to call back to
	 */
	public static ReverseGeocodingTask getAddressListForLocation(Context context, Double latitude, Double longitude, GeocodingTaskListener listener)
	{
		return getAddressListForLocation(context, latitude, longitude, listener,10);
	}

	/**
	 * Reverse geocode the location into an address
	 * @param context The context of the request
	 * @param latitude The latitude to lookup
	 * @param longitude The longitude to check
	 * @param listener The listener to call back to
	 */
	public static ReverseGeocodingTask getAddressListForLocation(Context context, Double latitude, Double longitude, GeocodingTaskListener listener, int resultCount)
	{
		ReverseGeocodingTask geocodingTask = new ReverseGeocodingTask(context);
		geocodingTask.setGeocodingTaskListener(listener);
		geocodingTask.setResultCount(resultCount);
		geocodingTask.execute(latitude, longitude);

		return geocodingTask;
	}

	/**
	 * Get the current location of the user to the given accuracy
	 * @param context The context of the request
	 * @param accuracy The accuracy to which the users location should match.
	 * @param listener The listener to call back to
	 */
	public static CurrentLocationTask getCurrentLocation(Context context, Accuracy accuracy, CurrentLocationListener listener)
	{
		CurrentLocationTask currentLocationTask = new CurrentLocationTask(context);
		currentLocationTask.setCurrentLocationListener(listener);
		currentLocationTask.execute(accuracy);

		return currentLocationTask;
	}

	/**
	 * Get the current location of the user to the closest 50 metres.
	 * @param context The context of the request
	 * @param listener The listener to call back to
	 */
{'fraction_non_alphanumeric': 0.0658750353406842, 'fraction_numerical': 0.0019790783149561775, 'mean_word_length': 5.104400345125108, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '6431888', 'n_tokens_mistral': 1999, 'n_tokens_neox': 1801, 'n_words': 661}