internal MultiCategoryClassifyResultCollection(IList <MultiCategoryClassifyResult> list, TextDocumentBatchStatistics statistics,
                                                string projectName, string deploymentName) : base(list)
 {
     Statistics     = statistics;
     ProjectName    = projectName;
     DeploymentName = deploymentName;
 }
示例#2
0
 internal PiiEntitiesResult(IReadOnlyList <PiiDocumentEntities> documents, IReadOnlyList <DocumentError> errors, TextDocumentBatchStatistics statistics, string modelVersion)
 {
     Documents    = documents;
     Errors       = errors;
     Statistics   = statistics;
     ModelVersion = modelVersion;
 }
 internal AnalyzeBatchActionsResult(IReadOnlyCollection <ExtractKeyPhrasesActionResult> extractKeyPhrasesActionResult, IReadOnlyCollection <RecognizeEntitiesActionResult> recognizeEntitiesActionResults, IReadOnlyCollection <RecognizePiiEntitiesActionResult> recognizePiiEntitiesActionResults, TextDocumentBatchStatistics statistics)
 {
     ExtractKeyPhrasesActionsResults    = extractKeyPhrasesActionResult;
     RecognizeEntitiesActionsResults    = recognizeEntitiesActionResults;
     RecognizePiiEntitiesActionsResults = recognizePiiEntitiesActionResults;
     Statistics = statistics;
 }
        internal static PiiEntitiesResult DeserializePiiEntitiesResult(JsonElement element)
        {
            IReadOnlyList <PiiDocumentEntities>    documents  = default;
            IReadOnlyList <DocumentError>          errors     = default;
            Optional <TextDocumentBatchStatistics> statistics = default;
            string modelVersion = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("documents"))
                {
                    List <PiiDocumentEntities> array = new List <PiiDocumentEntities>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(PiiDocumentEntities.DeserializePiiDocumentEntities(item));
                    }
                    documents = array;
                    continue;
                }
                if (property.NameEquals("errors"))
                {
                    List <DocumentError> array = new List <DocumentError>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(DocumentError.DeserializeDocumentError(item));
                    }
                    errors = array;
                    continue;
                }
                if (property.NameEquals("statistics"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    statistics = TextDocumentBatchStatistics.DeserializeTextDocumentBatchStatistics(property.Value);
                    continue;
                }
                if (property.NameEquals("modelVersion"))
                {
                    modelVersion = property.Value.GetString();
                    continue;
                }
            }
            return(new PiiEntitiesResult(documents, errors, statistics.Value, modelVersion));
        }
示例#5
0
 /// <summary>
 /// Initializes a new instance of <see cref="TextAnalytics.RecognizeLinkedEntitiesResultCollection"/> for mocking purposes.
 /// </summary>
 /// <param name="list">Sets the collection of <see cref="TextAnalytics.RecognizeLinkedEntitiesResult"/>.</param>
 /// <param name="statistics">Sets the <see cref="RecognizeLinkedEntitiesResultCollection.Statistics"/> property.</param>
 /// <param name="modelVersion">Sets the <see cref="RecognizeLinkedEntitiesResultCollection.ModelVersion"/> property.</param>
 /// <returns>A new instance of <see cref="TextAnalytics.RecognizeLinkedEntitiesResultCollection"/> for mocking purposes.</returns>
 public static RecognizeLinkedEntitiesResultCollection RecognizeLinkedEntitiesResultCollection(IEnumerable <RecognizeLinkedEntitiesResult> list, TextDocumentBatchStatistics statistics, string modelVersion)
 {
     return(new RecognizeLinkedEntitiesResultCollection(list.ToList(), statistics, modelVersion));
 }
示例#6
0
 /// <summary>
 /// Initializes a new instance of <see cref="TextAnalytics.ExtractKeyPhrasesResultCollection"/> for mocking purposes.
 /// </summary>
 /// <param name="list">Sets the collection of <see cref="TextAnalytics.ExtractKeyPhrasesResult"/>.</param>
 /// <param name="statistics">Sets the <see cref="ExtractKeyPhrasesResultCollection.Statistics"/> property.</param>
 /// <param name="modelVersion">Sets the <see cref="ExtractKeyPhrasesResultCollection.ModelVersion"/> property.</param>
 /// <returns>A new instance of <see cref="TextAnalytics.ExtractKeyPhrasesResultCollection"/> for mocking purposes.</returns>
 public static ExtractKeyPhrasesResultCollection ExtractKeyPhrasesResultCollection(IEnumerable <ExtractKeyPhrasesResult> list, TextDocumentBatchStatistics statistics, string modelVersion)
 {
     return(new ExtractKeyPhrasesResultCollection(list.ToList(), statistics, modelVersion));
 }
示例#7
0
 /// <summary>
 /// Initializes a new instance of <see cref="TextAnalytics.DetectLanguageResultCollection"/> for mocking purposes.
 /// </summary>
 /// <param name="list">Sets the collection of <see cref="TextAnalytics.DetectLanguageResult"/>.</param>
 /// <param name="statistics">Sets the <see cref="DetectLanguageResultCollection.Statistics"/> property.</param>
 /// <param name="modelVersion">Sets the <see cref="DetectLanguageResultCollection.ModelVersion"/> property.</param>
 /// <returns>A new instance of <see cref="TextAnalytics.DetectLanguageResultCollection"/> for mocking purposes.</returns>
 public static DetectLanguageResultCollection DetectLanguageResultCollection(IEnumerable <DetectLanguageResult> list, TextDocumentBatchStatistics statistics, string modelVersion)
 {
     return(new DetectLanguageResultCollection(list.ToList(), statistics, modelVersion));
 }
示例#8
0
 /// <summary>
 /// Initializes a new instance of <see cref="TextAnalytics.AnalyzeSentimentResultCollection"/> for mocking purposes.
 /// </summary>
 /// <param name="list">Sets the collection of <see cref="TextAnalytics.AnalyzeSentimentResult"/>.</param>
 /// <param name="statistics">Sets the <see cref="AnalyzeSentimentResultCollection.Statistics"/> property.</param>
 /// <param name="modelVersion">Sets the <see cref="AnalyzeSentimentResultCollection.ModelVersion"/> property.</param>
 /// <returns>A new instance of <see cref="TextAnalytics.AnalyzeSentimentResultCollection"/> for mocking purposes.</returns>
 public static AnalyzeSentimentResultCollection AnalyzeSentimentResultCollection(IEnumerable <AnalyzeSentimentResult> list, TextDocumentBatchStatistics statistics, string modelVersion)
 {
     return(new AnalyzeSentimentResultCollection(list.ToList(), statistics, modelVersion));
 }
示例#9
0
 internal PiiEntitiesResult(IList <DocumentError> errors, TextDocumentBatchStatistics statistics, string modelVersion, IList <PiiResultDocumentsItem> documents) : base(errors, statistics, modelVersion)
 {
     Documents = documents;
 }
 /// <summary>
 /// </summary>
 /// <param name="list"></param>
 /// <param name="statistics"></param>
 /// <param name="modelVersion"></param>
 internal DetectLanguageResultCollection(IList <DetectLanguageResult> list, TextDocumentBatchStatistics statistics, string modelVersion) : base(list)
 {
     Statistics   = statistics;
     ModelVersion = modelVersion;
 }
示例#11
0
 internal ExtractKeyPhrasesResultCollection(IList <ExtractKeyPhrasesResult> list, TextDocumentBatchStatistics statistics, string modelVersion) : base(list)
 {
     Statistics   = statistics;
     ModelVersion = modelVersion;
 }
示例#12
0
 internal AnalyzeSentimentResultCollection(IList <AnalyzeSentimentResult> list, TextDocumentBatchStatistics statistics, string modelVersion) : base(list)
 {
     Statistics   = statistics;
     ModelVersion = modelVersion;
 }
示例#13
0
 internal RecognizeEntitiesResultCollection(IList <RecognizeEntitiesResult> list, TextDocumentBatchStatistics statistics, string modelVersion) : base(list)
 {
     Statistics   = statistics;
     ModelVersion = modelVersion;
 }
 internal RecognizeCustomEntitiesResultCollection(IList <RecognizeEntitiesResult> list, TextDocumentBatchStatistics statistics, string projectName, string deploymentName) : base(list)
 {
     Statistics     = statistics;
     DeploymentName = deploymentName;
     ProjectName    = projectName;
 }