Exemple #1
0
        public void IndexCreation2()
        {
            var questionList = Program.DefaultQuestionList;

            var medicaments = new Medicaments(Program.MedicamentsFileName);

            var meds =
                medicaments.FindMedicamentsInTexts(questionList.GetAllQuestions().Select(a => Tuple.Create(a.Id, a.WholeText))).ToList();
            File.WriteAllLines("MedicamentsIndexQuestionsCount.txt", meds.OrderByDescending(q => q.Ids.Count).Select(s => s.Word + "\t" + s.Ids.Count));
        }
Exemple #2
0
        public void IndexTest()
        {
            var questionList = Program.TestDefaultQuestionList;

            var medicaments = new Medicaments(Program.MedicamentsFileName);

            var meds =
                medicaments.FindMedicamentsInTexts(questionList.GetAllAnswers().Select(a => Tuple.Create(a.QuestionId, a.Text))).ToList();
            Console.WriteLine(String.Join("\n", meds.Select(s => s.ToString())));
        }
Exemple #3
0
 public static IEnumerable<InvertedIndexUnit> GetDefaultIndex()
 {
     return DataActualityChecker.Check(
         new Lazy<InvertedIndexUnit[]>(() =>
                                       	{
                                       		var questionList = Program.DefaultQuestionList;
                                       		var medicaments = new Medicaments(Program.MedicamentsFileName);
                                       		return medicaments
                                       			.FindMedicamentsInTexts(questionList
                                       			                        	.GetAllAnswers()
                                       			                        	.Select(a => Tuple.Create(a.QuestionId, a.Text))
                                       			)
                                                 .OrderByDescending(k => k.Ids.Count)
                                       			.ToArray();
                                       	}),
         InvertedIndexUnit.FormatStringWrite,
         InvertedIndexUnit.FormatStringParse,
         new FileDependencies(
             Program.MedicamentsIndexFileName,
             Program.MedicamentsFileName));
 }