From b4b859ec8c2a25ca502af48afaf5fd5e25fcab09 Mon Sep 17 00:00:00 2001 From: ManyTheFish Date: Thu, 9 Mar 2023 10:56:17 +0100 Subject: [PATCH] Fix typos --- meilisearch/src/search.rs | 8 ++++---- milli/src/index.rs | 2 +- .../extract/extract_docid_word_positions.rs | 10 +++++----- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/meilisearch/src/search.rs b/meilisearch/src/search.rs index ebf9ace1f..7e4a7da6a 100644 --- a/meilisearch/src/search.rs +++ b/meilisearch/src/search.rs @@ -375,15 +375,15 @@ pub fn perform_search( &displayed_ids, ); - let mut tokenizer_buidler = TokenizerBuilder::default(); - tokenizer_buidler.create_char_map(true); + let mut tokenizer_builder = TokenizerBuilder::default(); + tokenizer_builder.create_char_map(true); let script_lang_map = index.script_language(&rtxn)?; if !script_lang_map.is_empty() { - tokenizer_buidler.allow_list(&script_lang_map); + tokenizer_builder.allow_list(&script_lang_map); } - let mut formatter_builder = MatcherBuilder::new(matching_words, tokenizer_buidler.build()); + let mut formatter_builder = MatcherBuilder::new(matching_words, tokenizer_builder.build()); formatter_builder.crop_marker(query.crop_marker); formatter_builder.highlight_prefix(query.highlight_pre_tag); formatter_builder.highlight_suffix(query.highlight_post_tag); diff --git a/milli/src/index.rs b/milli/src/index.rs index 7a473c0b4..20e64f984 100644 --- a/milli/src/index.rs +++ b/milli/src/index.rs @@ -1224,7 +1224,7 @@ impl Index { } } - let threshold = total / 20; // 5% (arbitrar) + let threshold = total / 20; // 5% (arbitrary) for (script, language, count) in script_language_doc_count { if count > threshold { if let Some(languages) = script_language.get_mut(&script) { diff --git a/milli/src/update/index_documents/extract/extract_docid_word_positions.rs b/milli/src/update/index_documents/extract/extract_docid_word_positions.rs index 6eee90c06..56b1299d5 100644 --- a/milli/src/update/index_documents/extract/extract_docid_word_positions.rs +++ b/milli/src/update/index_documents/extract/extract_docid_word_positions.rs @@ -89,7 +89,7 @@ pub fn extract_docid_word_positions( // if the allow list is empty, meaning that no Language is considered frequent, // then we don't rerun the extraction. if !script_language.is_empty() { - // build a new temporar tokenizer including the allow list. + // build a new temporary tokenizer including the allow list. let mut tokenizer_builder = TokenizerBuilder::new(); if let Some(stop_words) = stop_words { tokenizer_builder.stop_words(stop_words); @@ -260,7 +260,7 @@ fn process_tokens<'a>( fn potential_language_detection_error(languages_frequency: &Vec<(Language, usize)>) -> bool { if languages_frequency.len() > 1 { - let threshold = compute_laguage_frequency_threshold(languages_frequency); + let threshold = compute_language_frequency_threshold(languages_frequency); languages_frequency.iter().any(|(_, c)| *c <= threshold) } else { false @@ -271,7 +271,7 @@ fn most_frequent_languages( (script, languages_frequency): (&Script, &Vec<(Language, usize)>), ) -> Option<(Script, Vec)> { if languages_frequency.len() > 1 { - let threshold = compute_laguage_frequency_threshold(languages_frequency); + let threshold = compute_language_frequency_threshold(languages_frequency); let languages: Vec<_> = languages_frequency.iter().filter(|(_, c)| *c > threshold).map(|(l, _)| *l).collect(); @@ -286,7 +286,7 @@ fn most_frequent_languages( } } -fn compute_laguage_frequency_threshold(languages_frequency: &[(Language, usize)]) -> usize { +fn compute_language_frequency_threshold(languages_frequency: &[(Language, usize)]) -> usize { let total: usize = languages_frequency.iter().map(|(_, c)| c).sum(); - total / 10 // 10% is a completely arbitrar value. + total / 10 // 10% is a completely arbitrary value. }