Beispiel #1
0
        private void AddTermsToContentModeratorTextResults(Screen screen, ContentModeratorTextResults contentModeratorTextResults)
        {
            if (screen.Terms != null)
            {
                foreach (var term in screen.Terms)
                {
                    var termResultItem = new ContentModeratorTextResultItem
                    {
                        Text  = term.Term,
                        Index = term.Index ?? 0,
                        Label = term.ListId.HasValue ? term.ListId.Value.ToString() : null
                    };

                    contentModeratorTextResults.ProfaneTerms.Add(termResultItem);
                }

                contentModeratorTextResults.DoesContainProfaneTerms = contentModeratorTextResults.ProfaneTerms.Count > 0;
            }
        }
Beispiel #2
0
        private void AddPiiToContentModeratorTextResults(Screen screen, ContentModeratorTextResults contentModeratorTextResults)
        {
            if (screen.PII != null)
            {
                if (screen.PII.Address != null)
                {
                    foreach (var address in screen.PII.Address)
                    {
                        var resultItem = new ContentModeratorTextResultItem
                        {
                            Index = address.Index ?? 0,
                            Text  = address.Text,
                            Label = "Address"
                        };
                        contentModeratorTextResults.Pii.Add(resultItem);
                    }
                }

                if (screen.PII.Email != null)
                {
                    foreach (var email in screen.PII.Email)
                    {
                        var resultItem = new ContentModeratorTextResultItem
                        {
                            Index = email.Index ?? 0,
                            Text  = email.Text,
                            Label = "Email"
                        };
                        contentModeratorTextResults.Pii.Add(resultItem);
                    }
                }

                if (screen.PII.IPA != null)
                {
                    foreach (var ipa in screen.PII.IPA)
                    {
                        var resultItem = new ContentModeratorTextResultItem
                        {
                            Index = ipa.Index ?? 0,
                            Text  = ipa.Text,
                            Label = "IPA"
                        };
                        contentModeratorTextResults.Pii.Add(resultItem);
                    }
                }

                if (screen.PII.Phone != null)
                {
                    foreach (var phone in screen.PII.Phone)
                    {
                        var resultItem = new ContentModeratorTextResultItem
                        {
                            Index = phone.Index ?? 0,
                            Text  = phone.CountryCode + " " + phone.Text,
                            Label = "Phone"
                        };
                        contentModeratorTextResults.Pii.Add(resultItem);
                    }
                }

                if (screen.PII.SSN != null)
                {
                    foreach (var ssn in screen.PII.SSN)
                    {
                        var resultItem = new ContentModeratorTextResultItem
                        {
                            Index = ssn.Index ?? 0,
                            Text  = ssn.Text,
                            Label = "SSN"
                        };
                        contentModeratorTextResults.Pii.Add(resultItem);
                    }
                }

                contentModeratorTextResults.DoesContainPii = contentModeratorTextResults.Pii.Count > 0;
            }
        }