Added search terms to math commands (#5224)

This commit is contained in:
merelymyself 2022-04-19 05:33:32 +08:00 committed by GitHub
parent dd1d9b7623
commit 88ec4186ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 52 additions and 0 deletions

View File

@ -18,6 +18,10 @@ impl Command for SubCommand {
"Returns absolute values of a list of numbers"
}
fn search_terms(&self) -> Vec<&str> {
vec!["absolute", "modulus", "positive", "distance"]
}
fn run(
&self,
engine_state: &EngineState,

View File

@ -20,6 +20,10 @@ impl Command for SubCommand {
"Finds the average of a list of numbers or tables"
}
fn search_terms(&self) -> Vec<&str> {
vec!["average", "mean"]
}
fn run(
&self,
_engine_state: &EngineState,

View File

@ -18,6 +18,10 @@ impl Command for SubCommand {
"Applies the ceil function to a list of numbers"
}
fn search_terms(&self) -> Vec<&str> {
vec!["ceiling"]
}
fn run(
&self,
engine_state: &EngineState,

View File

@ -17,6 +17,10 @@ impl Command for SubCommand {
"Evaluate a math expression into a number"
}
fn search_terms(&self) -> Vec<&str> {
vec!["evaluation", "solve", "equation", "expression"]
}
fn signature(&self) -> Signature {
Signature::build("math eval")
.optional(

View File

@ -20,6 +20,10 @@ impl Command for SubCommand {
"Finds the maximum within a list of numbers or tables"
}
fn search_terms(&self) -> Vec<&str> {
vec!["maximum", "largest"]
}
fn run(
&self,
_engine_state: &EngineState,

View File

@ -22,6 +22,10 @@ impl Command for SubCommand {
"Gets the median of a list of numbers"
}
fn search_terms(&self) -> Vec<&str> {
vec!["middle", "average"]
}
fn run(
&self,
_engine_state: &EngineState,

View File

@ -20,6 +20,10 @@ impl Command for SubCommand {
"Finds the minimum within a list of numbers or tables"
}
fn search_terms(&self) -> Vec<&str> {
vec!["minimum", "smallest"]
}
fn run(
&self,
_engine_state: &EngineState,

View File

@ -43,6 +43,10 @@ impl Command for SubCommand {
"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(
&self,
_engine_state: &EngineState,

View File

@ -20,6 +20,10 @@ impl Command for SubCommand {
"Finds the product of a list of numbers or tables"
}
fn search_terms(&self) -> Vec<&str> {
vec!["times", "multiply", "x", "*"]
}
fn run(
&self,
_engine_state: &EngineState,

View File

@ -28,6 +28,10 @@ impl Command for SubCommand {
"Applies the round function to a list of numbers"
}
fn search_terms(&self) -> Vec<&str> {
vec!["approx", "rough"]
}
fn run(
&self,
engine_state: &EngineState,

View File

@ -18,6 +18,10 @@ impl Command for SubCommand {
"Applies the square root function to a list of numbers"
}
fn search_terms(&self) -> Vec<&str> {
vec!["square", "root"]
}
fn run(
&self,
engine_state: &EngineState,

View File

@ -22,6 +22,10 @@ impl Command for SubCommand {
"Finds the stddev of a list of numbers or tables"
}
fn search_terms(&self) -> Vec<&str> {
vec!["SD", "standard", "deviation", "dispersion", "variation"]
}
fn run(
&self,
_engine_state: &EngineState,

View File

@ -20,6 +20,10 @@ impl Command for SubCommand {
"Finds the sum of a list of numbers or tables"
}
fn search_terms(&self) -> Vec<&str> {
vec!["plus", "add", "+"]
}
fn run(
&self,
_engine_state: &EngineState,