我如何匹配句子中的所有單詞?詞:[“測試”,“測試通知”,“結果警報”,“警報測試”]句子:“報警結果測試”我期待這樣的事情[o] test[x] test noti[o] result alarm[o] alarm test我試著用文字分開,var words []stringwords = append(words, "test", "test noti", "result alarm", "alarm test")sentence := "alarm result test"for i := 0; i < len(words); i++ { log.Info(strings.Split(words[i], " "))}
所有單詞都包含在 golang 的句子中
慕的地6264312
2022-10-31 15:41:54