photoprism/pkg/txt/quote.go
Michael Mayer 2e85b3cccd People: Split facial recognition into smaller functions #22
Clustering and matching have been improved along the way. This opens
the door for further optimizations while keeping the code readable.
2021-08-22 16:14:34 +02:00

15 lines
243 B
Go

package txt
import (
"fmt"
"strings"
)
// Quote adds quotation marks to a string if needed.
func Quote(text string) string {
if text == "" || strings.ContainsAny(text, " \n'\"") {
return fmt.Sprintf("“%s”", text)
}
return text
}