If my search finds the "what", "is", "my", "lecture", "score" in one of the sentence list in any order, the result will be true, otherwise false.
Here is my sentence list as a List:
class vaModel {
final int id;
final List stringData;
final String response;
vaModel({
required this.id,
required this.stringData,
required this.response,
});
}
and here is the data of this model:
import "package:flut2deneme/pages/vaModel.dart";
List vaData = [
vaModel(id: 1, stringData: ["what", "my", "score", "lecture"], response: "load1"),
vaModel(id: 2, stringData: ["total", "lectures", "hours", "week"], response: "load2"),
vaModel(id: 3, stringData: ["how", "much", "cost"], response: "load3"),
//other
];
for example, if the user enters "what my score is for this lecture", it will return "load1" in id:1 in the vaData list. Because however the order is different and it has more other words, the desired words (what, my, score, lecture) are found in the data list. As seen, there are other words in the received sentence and the words are not in given order, the result is true, since all required words exist in item 1 (id:1)
It may also be explained in searching a list in a list of List.
Thank you for any support.
0 comments:
Post a Comment
Thanks