| | 1 | | // <auto-generated> |
| | 2 | | // Code generated by Microsoft (R) AutoRest Code Generator. |
| | 3 | | // Changes may cause incorrect behavior and will be lost if the code is |
| | 4 | | // regenerated. |
| | 5 | | // </auto-generated> |
| | 6 | |
|
| | 7 | | namespace Microsoft.Azure.CognitiveServices.ContentModerator |
| | 8 | | { |
| | 9 | | using Models; |
| | 10 | | using System.IO; |
| | 11 | | using System.Threading; |
| | 12 | | using System.Threading.Tasks; |
| | 13 | |
|
| | 14 | | /// <summary> |
| | 15 | | /// Extension methods for TextModeration. |
| | 16 | | /// </summary> |
| | 17 | | public static partial class TextModerationExtensions |
| | 18 | | { |
| | 19 | | /// <summary> |
| | 20 | | /// Detect profanity and match against custom and shared blacklists |
| | 21 | | /// </summary> |
| | 22 | | /// <remarks> |
| | 23 | | /// Detects profanity in more than 100 languages and match against custom and |
| | 24 | | /// shared blacklists. |
| | 25 | | /// </remarks> |
| | 26 | | /// <param name='operations'> |
| | 27 | | /// The operations group for this extension method. |
| | 28 | | /// </param> |
| | 29 | | /// <param name='textContentType'> |
| | 30 | | /// The content type. Possible values include: 'text/plain', 'text/html', |
| | 31 | | /// 'text/xml', 'text/markdown' |
| | 32 | | /// </param> |
| | 33 | | /// <param name='textContent'> |
| | 34 | | /// Content to screen. |
| | 35 | | /// </param> |
| | 36 | | /// <param name='language'> |
| | 37 | | /// Language of the text. |
| | 38 | | /// </param> |
| | 39 | | /// <param name='autocorrect'> |
| | 40 | | /// Autocorrect text. |
| | 41 | | /// </param> |
| | 42 | | /// <param name='pII'> |
| | 43 | | /// Detect personal identifiable information. |
| | 44 | | /// </param> |
| | 45 | | /// <param name='listId'> |
| | 46 | | /// The list Id. |
| | 47 | | /// </param> |
| | 48 | | /// <param name='classify'> |
| | 49 | | /// Classify input. |
| | 50 | | /// </param> |
| | 51 | | public static Screen ScreenText(this ITextModeration operations, string textContentType, Stream textContent, |
| | 52 | | { |
| 0 | 53 | | return operations.ScreenTextAsync(textContentType, textContent, language, autocorrect, pII, listId, clas |
| | 54 | | } |
| | 55 | |
|
| | 56 | | /// <summary> |
| | 57 | | /// Detect profanity and match against custom and shared blacklists |
| | 58 | | /// </summary> |
| | 59 | | /// <remarks> |
| | 60 | | /// Detects profanity in more than 100 languages and match against custom and |
| | 61 | | /// shared blacklists. |
| | 62 | | /// </remarks> |
| | 63 | | /// <param name='operations'> |
| | 64 | | /// The operations group for this extension method. |
| | 65 | | /// </param> |
| | 66 | | /// <param name='textContentType'> |
| | 67 | | /// The content type. Possible values include: 'text/plain', 'text/html', |
| | 68 | | /// 'text/xml', 'text/markdown' |
| | 69 | | /// </param> |
| | 70 | | /// <param name='textContent'> |
| | 71 | | /// Content to screen. |
| | 72 | | /// </param> |
| | 73 | | /// <param name='language'> |
| | 74 | | /// Language of the text. |
| | 75 | | /// </param> |
| | 76 | | /// <param name='autocorrect'> |
| | 77 | | /// Autocorrect text. |
| | 78 | | /// </param> |
| | 79 | | /// <param name='pII'> |
| | 80 | | /// Detect personal identifiable information. |
| | 81 | | /// </param> |
| | 82 | | /// <param name='listId'> |
| | 83 | | /// The list Id. |
| | 84 | | /// </param> |
| | 85 | | /// <param name='classify'> |
| | 86 | | /// Classify input. |
| | 87 | | /// </param> |
| | 88 | | /// <param name='cancellationToken'> |
| | 89 | | /// The cancellation token. |
| | 90 | | /// </param> |
| | 91 | | public static async Task<Screen> ScreenTextAsync(this ITextModeration operations, string textContentType, St |
| | 92 | | { |
| 0 | 93 | | using (var _result = await operations.ScreenTextWithHttpMessagesAsync(textContentType, textContent, lang |
| | 94 | | { |
| 0 | 95 | | return _result.Body; |
| | 96 | | } |
| 0 | 97 | | } |
| | 98 | |
|
| | 99 | | /// <summary> |
| | 100 | | /// This operation will detect the language of given input content. Returns the |
| | 101 | | /// <a href="http://www-01.sil.org/iso639-3/codes.asp">ISO 639-3 |
| | 102 | | /// code</a> for the predominant language comprising the submitted text. |
| | 103 | | /// Over 110 languages supported. |
| | 104 | | /// </summary> |
| | 105 | | /// <param name='operations'> |
| | 106 | | /// The operations group for this extension method. |
| | 107 | | /// </param> |
| | 108 | | /// <param name='textContentType'> |
| | 109 | | /// The content type. Possible values include: 'text/plain', 'text/html', |
| | 110 | | /// 'text/xml', 'text/markdown' |
| | 111 | | /// </param> |
| | 112 | | /// <param name='textContent'> |
| | 113 | | /// Content to screen. |
| | 114 | | /// </param> |
| | 115 | | public static DetectedLanguage DetectLanguage(this ITextModeration operations, string textContentType, Strea |
| | 116 | | { |
| 0 | 117 | | return operations.DetectLanguageAsync(textContentType, textContent).GetAwaiter().GetResult(); |
| | 118 | | } |
| | 119 | |
|
| | 120 | | /// <summary> |
| | 121 | | /// This operation will detect the language of given input content. Returns the |
| | 122 | | /// <a href="http://www-01.sil.org/iso639-3/codes.asp">ISO 639-3 |
| | 123 | | /// code</a> for the predominant language comprising the submitted text. |
| | 124 | | /// Over 110 languages supported. |
| | 125 | | /// </summary> |
| | 126 | | /// <param name='operations'> |
| | 127 | | /// The operations group for this extension method. |
| | 128 | | /// </param> |
| | 129 | | /// <param name='textContentType'> |
| | 130 | | /// The content type. Possible values include: 'text/plain', 'text/html', |
| | 131 | | /// 'text/xml', 'text/markdown' |
| | 132 | | /// </param> |
| | 133 | | /// <param name='textContent'> |
| | 134 | | /// Content to screen. |
| | 135 | | /// </param> |
| | 136 | | /// <param name='cancellationToken'> |
| | 137 | | /// The cancellation token. |
| | 138 | | /// </param> |
| | 139 | | public static async Task<DetectedLanguage> DetectLanguageAsync(this ITextModeration operations, string textC |
| | 140 | | { |
| 0 | 141 | | using (var _result = await operations.DetectLanguageWithHttpMessagesAsync(textContentType, textContent, |
| | 142 | | { |
| 0 | 143 | | return _result.Body; |
| | 144 | | } |
| 0 | 145 | | } |
| | 146 | |
|
| | 147 | | } |
| | 148 | | } |