Ejemplo n.º 1
0
        private void UpdateDescription(OrganizationReferent organization)
        {
            var text = organization.Occurrence
                       .OrderByDescending(c => c.EndChar - c.BeginChar)
                       .FirstOrDefault()?.GetText()?.RemoveWhitespace();

            UpdateDescription($"Организация: {text}\n");
        }
Ejemplo n.º 2
0
 public void Fill(OrganizationReferent orgainzation)
 {
     Name = orgainzation.Occurrence
            .OrderByDescending(c => c.EndChar - c.BeginChar)
            .FirstOrDefault()?.GetText()?.RemoveWhitespace();
     INN  = orgainzation.INN;
     OGRN = orgainzation.OGRN;
     // Description = string.Join("\n", orgainzation.Slots.Select(c => c.Value.ToString()));
 }
Ejemplo n.º 3
0
 private static OrganizationReferent GetHigher(OrganizationReferent organization)
 {
     while (true)
     {
         if (organization.Higher == null)
         {
             return(organization);
         }
         organization = organization.Higher;
     }
 }
Ejemplo n.º 4
0
        private Participant RecognizeParticipant(string text, int startOccurance, int endOccurance, OrganizationReferent organizationReferent)
        {
            var participant = new Participant
            {
                Name = organizationReferent.ToString()
            };
            var str = text.Substring(endOccurance,
                                     text.Length - endOccurance > 200
                                        ? 200
                                        : (text.Length - endOccurance));
            var uriAnalysisResult = _uriProcessor.Process(new SourceOfAnalysis(str));

            if (uriAnalysisResult.Entities?.Count > 0)
            {
                participant.Inn = uriAnalysisResult.Entities.OfType <UriReferent>()
                                  .FirstOrDefault(x => x.Scheme == "ИНН")?.Value;
                participant.Ogrn = uriAnalysisResult.Entities.OfType <UriReferent>()
                                   .FirstOrDefault(x => x.Scheme == "ОГРН")?.Value;
            }
            else
            {
                str = text.Substring(startOccurance < 200 ? 0 : startOccurance - 200,
                                     200);
                uriAnalysisResult = _uriProcessor.Process(new SourceOfAnalysis(str));
                if (uriAnalysisResult.Entities?.Count > 0)
                {
                    participant.Inn = uriAnalysisResult.Entities.OfType <UriReferent>()
                                      .FirstOrDefault(x => x.Scheme == "ИНН")?.Value;
                    participant.Ogrn = uriAnalysisResult.Entities.OfType <UriReferent>()
                                       .FirstOrDefault(x => x.Scheme == "ОГРН")?.Value;
                }
            }

            return(participant);
        }
Ejemplo n.º 5
0
 public CompanyReferent(OrganizationReferent orgainzation)
 {
     Fill(orgainzation);
 }