public void AddNewCluePairs(string clue) { string[] clueFragments = SeperateClueFragments(clue); for (int i = clueFragments.Length - 1; i > 0; i--) { string formerClue = clueFragments[i - 1]; string latterClue = clueFragments[i]; CluePairs.Add(formerClue, latterClue); } }
/// <summary> /// Search next available clue from previous usage history /// </summary> /// <param name="cursorLocation"><Dev>Pending implementation</param> /// <param name="currentSearch">Current complete search input, might not be just key phrases</param> /// <param name="keyPhrases"></param> /// <param name="nextClues"></param> /// <param name="foundDocuments"></param> public void GetNextClueFromPairs(string currentSearch, int cursorLocation, string[] keyPhrases, out List <ClueFragment> nextClues, out List <Document> foundDocuments) { // Genereate clues return List <string> nextPhrases = CluePairs.Get(keyPhrases.Last()); nextClues = new List <ClueFragment>(); foreach (string phrase in nextPhrases) { List <string> newPhrases = keyPhrases.ToList(); newPhrases.Add(phrase); List <Document> clueDocuments = GetDocumentsFromPhrases(newPhrases.ToArray()); nextClues.Add(new ClueFragment(phrase, clueDocuments.Count, string.Join("-", newPhrases), clueDocuments)); } foundDocuments = null; // Generate found focuments return foundDocuments = GetDocumentsFromPhrases(keyPhrases); }