Updates the paragraphs interlinear data and collects which annotations have been affected so we can update the display appropriately.
Inheritance: InterlinViewCacheLoader
Exemplo n.º 1
0
		private void UpdateGuesses(HashSet<IWfiWordform> wordforms, bool fUpdateDisplayWhereNeeded)
		{
			// now update the guesses for the paragraphs.
			var pdut = new ParaDataUpdateTracker(m_vc.GuessServices, m_vc.Decorator);
			foreach (IStTxtPara para in RootStText.ParagraphsOS)
				pdut.LoadAnalysisData(para, wordforms);
			if (fUpdateDisplayWhereNeeded)
			{
				// now update the display with the affected annotations.
				foreach (var changed in pdut.ChangedAnnotations)
					UpdateDisplayForOccurrence(changed);
			}
		}
Exemplo n.º 2
0
		/// <summary>
		/// Update any necessary guesses when the specified wordforms change.
		/// </summary>
		/// <param name="wordforms"></param>
		private void UpdateGuesses(Set<int> wordforms)
		{
			ISilDataAccess sda = m_fdoCache.MainCacheAccessor;
			int cpara = sda.get_VecSize(m_hvoRoot, (int)StText.StTextTags.kflidParagraphs);
			// now update the guesses for the paragraphs.
			ParaDataUpdateTracker pdut = new ParaDataUpdateTracker(Cache);
			for (int ipara = 0; ipara < cpara; ++ipara)
			{
				int hvoPara = sda.get_VecItem(m_hvoRoot, (int)StText.StTextTags.kflidParagraphs, ipara);
				if (NeedsGuessesUpdated(hvoPara, wordforms))
					pdut.LoadAnalysisData(hvoPara);
				//pdut.LoadParaData(hvoPara); //This also loads all annotations which never affect guesses and take 3 times the number of queries
			}
			// now update the display with the affected annotations.
			foreach (int hvoAnnotationChanged in pdut.ChangedAnnotations)
				SimulateReplaceAnnotation(hvoAnnotationChanged);
		}