forked from extern/nushell
Added search terms to math commands (#5224)
This commit is contained in:
parent
dd1d9b7623
commit
88ec4186ec
@ -18,6 +18,10 @@ impl Command for SubCommand {
|
|||||||
"Returns absolute values of a list of numbers"
|
"Returns absolute values of a list of numbers"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn search_terms(&self) -> Vec<&str> {
|
||||||
|
vec!["absolute", "modulus", "positive", "distance"]
|
||||||
|
}
|
||||||
|
|
||||||
fn run(
|
fn run(
|
||||||
&self,
|
&self,
|
||||||
engine_state: &EngineState,
|
engine_state: &EngineState,
|
||||||
|
@ -20,6 +20,10 @@ impl Command for SubCommand {
|
|||||||
"Finds the average of a list of numbers or tables"
|
"Finds the average of a list of numbers or tables"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn search_terms(&self) -> Vec<&str> {
|
||||||
|
vec!["average", "mean"]
|
||||||
|
}
|
||||||
|
|
||||||
fn run(
|
fn run(
|
||||||
&self,
|
&self,
|
||||||
_engine_state: &EngineState,
|
_engine_state: &EngineState,
|
||||||
|
@ -18,6 +18,10 @@ impl Command for SubCommand {
|
|||||||
"Applies the ceil function to a list of numbers"
|
"Applies the ceil function to a list of numbers"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn search_terms(&self) -> Vec<&str> {
|
||||||
|
vec!["ceiling"]
|
||||||
|
}
|
||||||
|
|
||||||
fn run(
|
fn run(
|
||||||
&self,
|
&self,
|
||||||
engine_state: &EngineState,
|
engine_state: &EngineState,
|
||||||
|
@ -17,6 +17,10 @@ impl Command for SubCommand {
|
|||||||
"Evaluate a math expression into a number"
|
"Evaluate a math expression into a number"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn search_terms(&self) -> Vec<&str> {
|
||||||
|
vec!["evaluation", "solve", "equation", "expression"]
|
||||||
|
}
|
||||||
|
|
||||||
fn signature(&self) -> Signature {
|
fn signature(&self) -> Signature {
|
||||||
Signature::build("math eval")
|
Signature::build("math eval")
|
||||||
.optional(
|
.optional(
|
||||||
|
@ -20,6 +20,10 @@ impl Command for SubCommand {
|
|||||||
"Finds the maximum within a list of numbers or tables"
|
"Finds the maximum within a list of numbers or tables"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn search_terms(&self) -> Vec<&str> {
|
||||||
|
vec!["maximum", "largest"]
|
||||||
|
}
|
||||||
|
|
||||||
fn run(
|
fn run(
|
||||||
&self,
|
&self,
|
||||||
_engine_state: &EngineState,
|
_engine_state: &EngineState,
|
||||||
|
@ -22,6 +22,10 @@ impl Command for SubCommand {
|
|||||||
"Gets the median of a list of numbers"
|
"Gets the median of a list of numbers"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn search_terms(&self) -> Vec<&str> {
|
||||||
|
vec!["middle", "average"]
|
||||||
|
}
|
||||||
|
|
||||||
fn run(
|
fn run(
|
||||||
&self,
|
&self,
|
||||||
_engine_state: &EngineState,
|
_engine_state: &EngineState,
|
||||||
|
@ -20,6 +20,10 @@ impl Command for SubCommand {
|
|||||||
"Finds the minimum within a list of numbers or tables"
|
"Finds the minimum within a list of numbers or tables"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn search_terms(&self) -> Vec<&str> {
|
||||||
|
vec!["minimum", "smallest"]
|
||||||
|
}
|
||||||
|
|
||||||
fn run(
|
fn run(
|
||||||
&self,
|
&self,
|
||||||
_engine_state: &EngineState,
|
_engine_state: &EngineState,
|
||||||
|
@ -43,6 +43,10 @@ impl Command for SubCommand {
|
|||||||
"Gets the most frequent element(s) from a list of numbers or tables"
|
"Gets the most frequent element(s) from a list of numbers or tables"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn search_terms(&self) -> Vec<&str> {
|
||||||
|
vec!["common", "often", "average"]
|
||||||
|
}
|
||||||
|
|
||||||
fn run(
|
fn run(
|
||||||
&self,
|
&self,
|
||||||
_engine_state: &EngineState,
|
_engine_state: &EngineState,
|
||||||
|
@ -20,6 +20,10 @@ impl Command for SubCommand {
|
|||||||
"Finds the product of a list of numbers or tables"
|
"Finds the product of a list of numbers or tables"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn search_terms(&self) -> Vec<&str> {
|
||||||
|
vec!["times", "multiply", "x", "*"]
|
||||||
|
}
|
||||||
|
|
||||||
fn run(
|
fn run(
|
||||||
&self,
|
&self,
|
||||||
_engine_state: &EngineState,
|
_engine_state: &EngineState,
|
||||||
|
@ -28,6 +28,10 @@ impl Command for SubCommand {
|
|||||||
"Applies the round function to a list of numbers"
|
"Applies the round function to a list of numbers"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn search_terms(&self) -> Vec<&str> {
|
||||||
|
vec!["approx", "rough"]
|
||||||
|
}
|
||||||
|
|
||||||
fn run(
|
fn run(
|
||||||
&self,
|
&self,
|
||||||
engine_state: &EngineState,
|
engine_state: &EngineState,
|
||||||
|
@ -18,6 +18,10 @@ impl Command for SubCommand {
|
|||||||
"Applies the square root function to a list of numbers"
|
"Applies the square root function to a list of numbers"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn search_terms(&self) -> Vec<&str> {
|
||||||
|
vec!["square", "root"]
|
||||||
|
}
|
||||||
|
|
||||||
fn run(
|
fn run(
|
||||||
&self,
|
&self,
|
||||||
engine_state: &EngineState,
|
engine_state: &EngineState,
|
||||||
|
@ -22,6 +22,10 @@ impl Command for SubCommand {
|
|||||||
"Finds the stddev of a list of numbers or tables"
|
"Finds the stddev of a list of numbers or tables"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn search_terms(&self) -> Vec<&str> {
|
||||||
|
vec!["SD", "standard", "deviation", "dispersion", "variation"]
|
||||||
|
}
|
||||||
|
|
||||||
fn run(
|
fn run(
|
||||||
&self,
|
&self,
|
||||||
_engine_state: &EngineState,
|
_engine_state: &EngineState,
|
||||||
|
@ -20,6 +20,10 @@ impl Command for SubCommand {
|
|||||||
"Finds the sum of a list of numbers or tables"
|
"Finds the sum of a list of numbers or tables"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn search_terms(&self) -> Vec<&str> {
|
||||||
|
vec!["plus", "add", "+"]
|
||||||
|
}
|
||||||
|
|
||||||
fn run(
|
fn run(
|
||||||
&self,
|
&self,
|
||||||
_engine_state: &EngineState,
|
_engine_state: &EngineState,
|
||||||
|
Loading…
Reference in New Issue
Block a user