Detecting paraphrases in text with GroupDocs.Rewriter SDK
Detecting paraphrases in text with GroupDocs.Rewriter SDK
Leave feedback
Although you can directly call the GroupDocs.Rewriter Cloud REST API to send text and fetch the result, there is a much easier way to implement required functionality in your applications. We provide software development kits (SDKs) for all popular programming languages. They wrap up all routine operations such as establishing connections, sending API requests, and parsing responses into a few simple methods. It makes interaction with GroupDocs.Rewriter Cloud services much easier, allowing you to focus on business logic rather than technical details.
usingGroupDocs.Rewriter.Cloud.Sdk.Api;usingGroupDocs.Rewriter.Cloud.Sdk.Client;usingGroupDocs.Rewriter.Cloud.Sdk.Client.Auth;usingGroupDocs.Rewriter.Cloud.Sdk.Model;usingConfiguration=GroupDocs.Rewriter.Cloud.Sdk.Client.Configuration;usingSystem.Diagnostics;usingSystem.IO;usingSystem.Collections.Generic;usingSystem.Net.Http;usingHttpStatusCode=System.Net.HttpStatusCode;namespaceGroupDocs.Rewriter.Cloud.Sdk{publicclassTextDetector{publicTextDetector(){Configurationconfig=newConfiguration();config.OAuthFlow=OAuthFlow.APPLICATION;config.OAuthClientId="YOU_CLIENT_ID";config.OAuthClientSecret="YOU_CLIENT_SECRET";config.BasePath="https://api.groupdocs.cloud/v2.0/rewriter";DetectApiapi=newDetectApi(conf);stringsrcText="YOUR_TEXT";stringsourceLanguage="en";DetectionTextResponsetextResponse=newDetectionTextResponse();DetectionTextRequestrequest=newDetectionTextRequest(language:sourceLanguage,text:srcText);StatusResponseresponseId=awaitapi.DetectTextPostAsync(request);;try{if(responseId.Status.ToString()=="Accepted"){while(true){textResponse=awaitapi.DetectTextRequestIdGetAsync(responseId.Id);if(textResponse.Status.ToString()=="OK"){Console.WriteLine("Plain text detection probability: "+textResponse.Probability);break;}elseThread.Sleep(2000);}}else{textResponse=newDetectionTextResponse(){Status=responseId.Status,Message=responseId.Message};Console.WriteLine("Text error: "+textResponse.Message);}}catch(Exceptionex){Console.WriteLine("Text exception: "+ex.ToString());}}}}