Exemple #1
0
        public virtual Referent Clone()
        {
            Referent res = ProcessorService.CreateReferent(TypeName);

            if (res == null)
            {
                res = new Referent(TypeName);
            }
            res.Occurrence.AddRange(Occurrence);
            res.OntologyItems = OntologyItems;
            foreach (Slot r in Slots)
            {
                Slot rr = new Slot()
                {
                    TypeName = r.TypeName, Value = r.Value, Count = r.Count
                };
                rr.Owner = res;
                res.Slots.Add(rr);
            }
            return(res);
        }
Exemple #2
0
        internal void Deserialize(Stream stream)
        {
            ExtId     = Pullenti.Ner.Core.Internal.SerializerHelper.DeserializeString(stream);
            m_Caption = Pullenti.Ner.Core.Internal.SerializerHelper.DeserializeString(stream);
            int cou = Pullenti.Ner.Core.Internal.SerializerHelper.DeserializeInt(stream);

            if (cou > 0)
            {
                Refs = new List <Referent>();
                for (; cou > 0; cou--)
                {
                    string   typ = Pullenti.Ner.Core.Internal.SerializerHelper.DeserializeString(stream);
                    Referent r   = ProcessorService.CreateReferent(typ);
                    r.Deserialize(stream, Refs, null);
                    Refs.Add(r);
                }
            }
            TypeName = Pullenti.Ner.Core.Internal.SerializerHelper.DeserializeString(stream);
            Referent = ProcessorService.CreateReferent(TypeName);
            Referent.Deserialize(stream, Refs, null);
        }
Exemple #3
0
 void _init()
 {
     m_Processor  = ProcessorService.CreateSpecificProcessor(m_Specs);
     m_AnalByType = new Dictionary <string, Analyzer>();
     foreach (Analyzer a in m_Processor.Analyzers)
     {
         a.PersistReferentsRegim = true;
         if (a.Name == "DENOMINATION")
         {
             a.IgnoreThisAnalyzer = true;
         }
         else
         {
             foreach (Pullenti.Ner.Metadata.ReferentClass t in a.TypeSystem)
             {
                 if (!m_AnalByType.ContainsKey(t.Name))
                 {
                     m_AnalByType.Add(t.Name, a);
                 }
             }
         }
     }
 }