Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Azure Search] Add new skill and cognitive services attachment to SDK #5223

Merged
merged 15 commits into from
Feb 15, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ namespace Microsoft.Azure.Search.Models
using System.Runtime.Serialization;

/// <summary>
/// Defines values for NamedEntityCategory.
/// Defines values for NamedEntityCategory. This is deprecated, use <see cref="EntityCategory"/> instead
/// </summary>
[JsonConverter(typeof(StringEnumConverter))]
[Obsolete("NamedEntityCategory is deprecated. Use EntityCategory instead.")]
public enum NamedEntityCategory
{
[EnumMember(Value = "location")]
Expand Down Expand Up @@ -45,6 +46,7 @@ internal static string ToSerializedValue(this NamedEntityCategory value)
return null;
}

[Obsolete]
internal static NamedEntityCategory? ParseNamedEntityCategory(this string value)
{
switch (value)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@ namespace Microsoft.Azure.Search.Models
using System.Linq;

/// <summary>
/// Text analytics named entity recognition.
/// Text analytics named entity recognition. This skill is deprecated in favor of <see cref="EntityRecognitionSkill"/>
/// <see
/// href="https://docs.microsoft.com/azure/search/cognitive-search-skill-named-entity-recognition"
/// />
/// </summary>
[Newtonsoft.Json.JsonObject("#Microsoft.Skills.Text.NamedEntityRecognitionSkill")]
[Obsolete("NamedEntityRecognitionSkill is deprecated. Use EntityRecognitionSkill instead")]
public partial class NamedEntityRecognitionSkill : Skill
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@ namespace Microsoft.Azure.Search.Models

/// <summary>
/// Defines the format of NamedEntityRecognitionSkill supported language codes.
/// This is deprecated. Use <see cref="EntityRecognitionSkillLanguage"/> instead
/// </summary>
[JsonConverter(typeof(ExtensibleEnumConverter<NamedEntityRecognitionSkillLanguage>))]
[Obsolete("NamedEntityRecognitionSkillLanguage is deprecated. Use EntityRecognitionSkillLanguage instead.")]
public sealed class NamedEntityRecognitionSkillLanguage : ExtensibleEnum<NamedEntityRecognitionSkillLanguage>
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace Microsoft.Azure.Search.Tests
{
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
Expand Down Expand Up @@ -119,6 +120,7 @@ public void CreateSkillsetReturnsCorrectDefinitionOcrNamedEntity()

// Purely to test the still existing, but obsolete NamedEntityRecognitionSkill
[Fact]
[Obsolete]
public void CreateSkillsetReturnsCorrectDefinitionNamedEntity()
{
Run(() =>
Expand Down Expand Up @@ -199,6 +201,7 @@ public void CreateOrUpdateUpdatesWhenSkillsetExists()
// Explicit test to show that a skillset can be updated with the same number of skills,
// simply moving from the Obsolete NamedEntityRecognitionSkill to the EntityRecognitionSkill
[Fact]
[Obsolete]
public void CanUpdateSkillsetFromNamedEntityRecognitionSkillToEntityRecognitionSkill()
{
Run(() =>
Expand Down Expand Up @@ -874,6 +877,7 @@ private static Skillset CreateTestSkillsetOcrShaper()
}

// Helper method that will create functionally equivalent NamedEntityRecognitionSkill vs EntityRecognitionSkill
[Obsolete]
private static Skillset CreateTestSkillsetNamedEntityOrEntityRecognition(bool createEntitySkill)
{
List<Skill> skills = new List<Skill>();
Expand Down