c# - LINQ joining multiple lists -


i want able join multiple lists. i'm trying reply user best suitable answer. program reads sentence typed in user, stores infinitives, nouns, articles , adverbs in seperate lists , tries find best answer or reply user in list of structs pre-defined answers joining lists.

so list1 (the answer list) looks this

public struct ll {     int index;     string infinitive;     string noun;     string article;     string adverb;     string preposition;     string answer;         } public list <ll> list1; 

with below data:

enter image description here

when example user inputs sentence "what can find" join script should return 2 possible answers, being "i can find information" , "what want me find", because infinitive can found in users input , no noun, article, adverb, etc.

but when sentence more explicit "what can find here", return "i can find information", search done on infinitive in combination adverb.

also when user asks: "what know hobbit" return nothing combination "know" , "this" unknown, "what know hobbit" return "this know about"

i'm trying accomplish linq join statement like

var query = x in answer             join y1 in infinitive on x.infinitive equals y1             join y2 in noun on x.noun equals y2             join y3 in adverb on x.adverb equals y3             etc...             select x.index; 

the problem in case user types in "what know hobbit" return nothing because it's trying match user's infinitive "know" in combination preposition "about", should answer "this know about".


Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -