From 125e60d06a09eba0b564eca0cff4d110b8082192 Mon Sep 17 00:00:00 2001 From: valdaarhun <39989901+valdaarhun@users.noreply.github.com> Date: Fri, 8 Jul 2022 19:44:51 +0530 Subject: [PATCH] Add search terms to 'math' commands (#5990) * Remove 'average' from search_terms * Add search_terms to 'floor' and 'variance' --- crates/nu-command/src/math/floor.rs | 4 ++++ crates/nu-command/src/math/median.rs | 2 +- crates/nu-command/src/math/mode.rs | 2 +- crates/nu-command/src/math/variance.rs | 4 ++++ 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/crates/nu-command/src/math/floor.rs b/crates/nu-command/src/math/floor.rs index 919ac1de7f..d05698681a 100644 --- a/crates/nu-command/src/math/floor.rs +++ b/crates/nu-command/src/math/floor.rs @@ -18,6 +18,10 @@ impl Command for SubCommand { "Applies the floor function to a list of numbers" } + fn search_terms(&self) -> Vec<&str> { + vec!["floor"] + } + fn run( &self, engine_state: &EngineState, diff --git a/crates/nu-command/src/math/median.rs b/crates/nu-command/src/math/median.rs index b2f40b27f3..96e81b25c1 100644 --- a/crates/nu-command/src/math/median.rs +++ b/crates/nu-command/src/math/median.rs @@ -23,7 +23,7 @@ impl Command for SubCommand { } fn search_terms(&self) -> Vec<&str> { - vec!["middle", "average"] + vec!["middle", "median"] } fn run( diff --git a/crates/nu-command/src/math/mode.rs b/crates/nu-command/src/math/mode.rs index 7810ed9c32..2a57059c9c 100644 --- a/crates/nu-command/src/math/mode.rs +++ b/crates/nu-command/src/math/mode.rs @@ -44,7 +44,7 @@ impl Command for SubCommand { } fn search_terms(&self) -> Vec<&str> { - vec!["common", "often", "average"] + vec!["common", "often"] } fn run( diff --git a/crates/nu-command/src/math/variance.rs b/crates/nu-command/src/math/variance.rs index 4ab0718fd6..e630de7dd9 100644 --- a/crates/nu-command/src/math/variance.rs +++ b/crates/nu-command/src/math/variance.rs @@ -21,6 +21,10 @@ impl Command for SubCommand { "Finds the variance of a list of numbers or tables" } + fn search_terms(&self) -> Vec<&str> { + vec!["deviation", "dispersion", "variance", "variation"] + } + fn run( &self, _engine_state: &EngineState,