コード例 #1
0
ファイル: NonAtopicFile.cs プロジェクト: brnls/name-matching
        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;
        }
コード例 #2
0
        /// <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
            };
        }
コード例 #3
0
ファイル: BigramArray.cs プロジェクト: brnls/name-matching
        public static string[] createStringArray(MasterParticipant masterListParticipant)
        {
            string[] biGrams = BiGrams.CreateNGrams(masterListParticipant.name, 2);

            return biGrams;
        }