Example #1
0
 private static void AddEntityToModel(EntitiesCorpus model, int begin, int endi, NerType type, Dictionary<KeyValuePair<int, int>, NerTextEntity> allEntities)
 {
     NerTextEntity existing;
     if (allEntities.TryGetValue(new KeyValuePair<int, int>(begin, endi), out existing) && existing.Type != type)
     {
         model.Entities.Remove(existing);
     }
     if (existing != null)
     {
         return;
     }
     var ent = new NerTextEntity(begin, endi, type);
     model.Entities.Add(ent);
     allEntities.Add(new KeyValuePair<int, int>(begin, endi), ent);
 }
Example #2
0
        private static void AddEntityToModel(EntitiesCorpus model, int begin, int endi, NerType type, Dictionary <KeyValuePair <int, int>, NerTextEntity> allEntities)
        {
            NerTextEntity existing;

            if (allEntities.TryGetValue(new KeyValuePair <int, int>(begin, endi), out existing) && existing.Type != type)
            {
                model.Entities.Remove(existing);
            }
            if (existing != null)
            {
                return;
            }
            var ent = new NerTextEntity(begin, endi, type);

            model.Entities.Add(ent);
            allEntities.Add(new KeyValuePair <int, int>(begin, endi), ent);
        }