pub fn detect(categories: &[&str]) -> String {
let cats = categories.join("</c>");
format!("Locate all the instances that matches the following description: {cats}.")
}
pub fn ground_single(phrase: &str) -> String {
format!("Locate a single instance that matches the following description: {phrase}.")
}
pub fn ground_multi(phrase: &str) -> String {
format!("Locate all the instances that match the following description: {phrase}.")
}
pub fn ground_text(phrase: &str) -> String {
format!("Please locate the text referred as {phrase}.")
}
pub fn detect_text() -> String {
"Detect all the text in box format.".into()
}
pub fn ground_gui_box(phrase: &str) -> String {
format!("Locate the region that matches the following description: {phrase}.")
}
pub fn point(phrase: &str) -> String {
format!("Point to: {phrase}.")
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn detect_joins_categories() {
let p = detect(&["person", "car"]);
assert!(p.contains("person</c>car"));
}
}