I am using below code to filter the text
elements from the List A
and List D
and in which I am successful.
Upon printing I am able to get word by word result.
List A = ["ra", "rb", "rc","ball of ", "rd", "re"];
List D = ["p", "of","of iron" ,"r", "ball of ", "s", "a"];
String text = "This is a ball of iron";
bool filterLists2(text) { return [ A ].any((list) => list.contains(text)); }
List newString = text.toLowerCase().split(' ').where(filterLists2).toList();
bool filterLists1(text) { return [ D ].any((list) => list.contains(text)); }
List ns = text.toLowerCase().split(' ').where(filterLists1).toList();
But as the word by word separation is done and so the result is also available at the same time I also want to check for the phrases of words if there are any in the text and so in the lists which are being filtered.
How can I do that ? Please guide me
question from:
https://stackoverflow.com/questions/65898096/how-to-check-for-word-phrases-as-well-as-words-in-lists-in-flutter 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…