예제 #1
0
        private void UpdateSelectedChangeWordPairs(WordPairsViewModel wordPairs)
        {
            IWordAligner aligner = _projectService.Project.WordAligners[ComponentIdentifiers.PrimaryWordAligner];

            wordPairs.SelectedCorrespondenceWordPairs.Clear();
            foreach (WordPairViewModel wordPair in wordPairs.WordPairs)
            {
                bool selected = false;
                foreach (AlignedNodeViewModel node in wordPair.AlignedNodes)
                {
                    if (_selectedSoundChange == null)
                    {
                        node.IsSelected = false;
                    }
                    else
                    {
                        SoundContext    lhs  = wordPair.DomainAlignment.ToSoundContext(_segmentPool, 0, node.Column, aligner.ContextualSoundClasses);
                        Ngram <Segment> corr = wordPair.DomainAlignment[1, node.Column].ToNgram(_segmentPool);
                        node.IsSelected = lhs.Equals(_selectedSoundChange.DomainSoundChangeLhs) && corr.Equals(_selectedSoundChange.DomainCorrespondence);
                        if (node.IsSelected)
                        {
                            selected = true;
                        }
                    }
                }

                if (selected)
                {
                    wordPairs.SelectedCorrespondenceWordPairs.Add(wordPair);
                }
            }
        }
예제 #2
0
        public bool Equals(SoundChangeLhsViewModel other)
        {
            if (other == null)
            {
                return(false);
            }

            return(_lhs.Equals(other._lhs));
        }