Exemplo n.º 1
0
        /// <summary>
        /// Ensure that the segments property of the paragraph is consistent with its contents and consists of real
        /// database objects.
        /// </summary>
        internal static FdoCache EnsureMainParaSegments(IStTxtPara para, int wsBt)
        {
            ParagraphParser pp = new ParagraphParser(para);
            List <int>      EosOffsets;
            List <int>      segs = pp.CollectSegmentAnnotationsOfPara(out EosOffsets);
            // Make sure the segments list is up to date.
            FdoCache cache = para.Cache;

            cache.VwCacheDaAccessor.CacheVecProp(para.Hvo, StTxtPara.SegmentsFlid(cache), segs.ToArray(), segs.Count);
            // This further makes sure all are real.
            StTxtPara.LoadSegmentFreeTranslations(new int[] { para.Hvo }, cache, wsBt);
            return(cache);
        }