예제 #1
0
        /// <summary>
        /// Выдаёт словарь клауз и их отношений для всего предложения
        /// </summary>
        /// <param name="sentence">Предложение</param>
        /// <param name="bestVariantsNombers">варианты предложений</param>
        /// <returns>список отношений для всего предложения</returns>
        private Dictionary <int, List <IRelation> > getRelationsDict(ISentence sentence, int[] bestVariantsNombers)
        {
            Dictionary <int, List <IRelation> > relations = new Dictionary <int, List <IRelation> >();
            IRelationsIterator relationsIterator          = sentence.CreateRelationsIterator();

            for (int i = 0; i < sentence.ClausesCount; i++)
            {
                relationsIterator.Reset();
                relationsIterator.AddClauseNoAndVariantNo(i, bestVariantsNombers[i]);
                relationsIterator.BuildRelations();
                relations.Add(i, new List <IRelation>());
                for (int j = 0; j < relationsIterator.RelationsCount; j++)
                {
                    IRelation rel = relationsIterator.get_Relation(j);
                    relations[i].Add(rel);
                }
            }
            return(relations);
        }