コード例 #1
0
        /**
         * <summary>Returns SynSets with the synonym interlingual dependencies.</summary>
         *
         * <param name="secondLanguage">WordNet in other language to find relations</param>
         * <returns>a list of SynSets that has interlingual relations in it</returns>
         */
        public List <SynSet> GetInterlingual(WordNet secondLanguage)
        {
            var result = new List <SynSet>();

            foreach (var t in _relations)
            {
                if (t is InterlingualRelation relation)
                {
                    if (relation.GetType() == InterlingualDependencyType.SYNONYM)
                    {
                        var second = secondLanguage.GetSynSetWithId(relation.GetName());
                        if (second != null)
                        {
                            result.Add(second);
                        }
                    }
                }
            }

            return(result);
        }