<commit_before>package jp.toastkid.yobidashi.search

import android.content.Context
import android.net.Uri
import androidx.annotation.DrawableRes
import androidx.annotation.StringRes
import androidx.core.net.toUri
import jp.toastkid.yobidashi.R
import jp.toastkid.yobidashi.main.LocaleWrapper
import java.util.*

/**
 * Web search category.
 *
 * @author toastkidjp
 */
enum class SearchCategory(
        @StringRes val id: Int,
        @DrawableRes val iconId: Int,
        private val host: String,
        private val generator: (l: String, h: String, q: String) -> String = { _, h, q ->  h + q }
) {
    SITE_SEARCH(
            R.string.title_site_search_by_google,
            R.drawable.ic_site_search,
            "https://www.google.com/search?q="
    ),
    GOOGLE(
            R.string.google,
            R.drawable.ic_google,
            "https://www.google.com/search?q="
    ),
    YAHOO(
            R.string.search_category_yahoo,
            R.drawable.ic_yahoo,
            "https://search.yahoo.com/search?p="
    ),
    YAHOO_JAPAN(
            R.string.search_category_yahoo_japan,
            R.drawable.ic_yahoo_japan_logo,
            "https://search.yahoo.co.jp/search?p="
    ),
    WOLFRAM_ALPHA(
            R.string.wolfram_alpha,
            R.drawable.ic_wolfram_alpha,
            "https://www.wolframalpha.com/input/?i="
    ),
    AOL(
            R.string.aol,
            R.drawable.ic_aol,
            "https://www.aolsearch.com/search?s_chn=prt_bon-mobile&q="
    ),
    BING(
            R.string.bing,
            R.drawable.ic_bing_logo,
            "https://www.bing.com/search?q="
    ),
    DUCKDUCKGO(
            R.string.search_category_web,
            R.drawable.ic_duckduckgo,
            "https://duckduckgo.com/%s?ia=web",
            { _, h, q -> String.format(h, q)}
    ),
    ASK_COM(
            R.string.search_category_ask_com,<commit_msg>feature #412 Re-order search category.<commit_after>package jp.toastkid.yobidashi.search

import android.content.Context
import android.net.Uri
import androidx.annotation.DrawableRes
import androidx.annotation.StringRes
import androidx.core.net.toUri
import jp.toastkid.yobidashi.R
import jp.toastkid.yobidashi.main.LocaleWrapper
import java.util.*

/**
 * Web search category.
 *
 * @author toastkidjp
 */
enum class SearchCategory(
        @StringRes val id: Int,
        @DrawableRes val iconId: Int,
        private val host: String,
        private val generator: (l: String, h: String, q: String) -> String = { _, h, q ->  h + q }
) {
    SITE_SEARCH(
            R.string.title_site_search_by_google,
            R.drawable.ic_site_search,
            "https://www.google.com/search?q="
    ),
    GOOGLE(
            R.string.google,
            R.drawable.ic_google,
            "https://www.google.com/search?q="
    ),
    YAHOO(
            R.string.search_category_yahoo,
            R.drawable.ic_yahoo,
            "https://search.yahoo.com/search?p="
    ),
    YAHOO_JAPAN(
            R.string.search_category_yahoo_japan,
            R.drawable.ic_yahoo_japan_logo,
            "https://search.yahoo.co.jp/search?p="
    ),
    WOLFRAM_ALPHA(
            R.string.wolfram_alpha,
            R.drawable.ic_wolfram_alpha,
            "https://www.wolframalpha.com/input/?i="
    ),
    BING(
            R.string.bing,
            R.drawable.ic_bing_logo,
            "https://www.bing.com/search?q="
    ),
    DUCKDUCKGO(
            R.string.search_category_web,
            R.drawable.ic_duckduckgo,
            "https://duckduckgo.com/%s?ia=web",
            { _, h, q -> String.format(h, q)}
    ),
    AOL(
            R.string.aol,
            R.drawable.ic_aol,
            "https://www.aolsearch.com/search?s_chn=prt_bon-mobile&q="
    ),
    ASK_COM(
            R.string.search_category_ask_com,
{'fraction_non_alphanumeric': 0.12529427151451739, 'fraction_numerical': 0.0007847240387130526, 'mean_word_length': 1.975875486381323, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 16, 'lorem ipsum': 0, 'www.': 10, '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': '5526811', 'n_tokens_mistral': 1360, 'n_tokens_neox': 1307, 'n_words': 183}