public static List<MasterParticipant> ReturnNonAtopicList(string filePath) { string[] nonAtopics = System.IO.File.ReadAllLines(filePath + "nonatopics.csv").ToArray(); List<MasterParticipant> nonADList = new List<MasterParticipant>(); foreach (string s in nonAtopics) { MasterParticipant participant = new MasterParticipant(); string [] splitList = s.Split(','); string studyID = splitList[0]; participant.studyID = studyID; nonADList.Add(participant); } return nonADList; }
/// <summary> /// Creates a list, filtering out words that are longer by 3 characters. Based on Levenshtein Distance with a poor match being > 3 edits. /// </summary> /// <param name="masterParticipant"></param> /// <param name="compareTo"></param> /// <returns></returns> public static FirstComparison FilterByLength(MasterParticipant masterParticipant, List<ReportParticipant> compareTo) { int levenshteinEdits = 0; List<ReportParticipant> levenshteinList = new List<ReportParticipant>(); foreach (ReportParticipant reportParticipant in compareTo) { levenshteinEdits = Math.Abs(reportParticipant.name.Length - masterParticipant.name.Length); if (levenshteinEdits < 4 && (reportParticipant.name[0] == masterParticipant.name[0])) { levenshteinList.Add(reportParticipant); } } return new FirstComparison { MasterParticipant = masterParticipant, FilteredMatchesByLength = levenshteinList }; }
public static string[] createStringArray(MasterParticipant masterListParticipant) { string[] biGrams = BiGrams.CreateNGrams(masterListParticipant.name, 2); return biGrams; }