<dependency>
<groupId>com.groupdocs</groupId>
<artifactId>groupdocs-rewriter-cloud</artifactId>
<version>24.12</version>
</dependency>
compile(group: 'com.groupdocs', name: 'groupdocs-rewriter-cloud', version: '24.12')
<dependency org="com.groupdocs" name="groupdocs-rewriter-cloud" rev="24.12">
<artifact name="groupdocs-rewriter-cloud" ext="jar"/>
</dependency>
libraryDependencies += "com.groupdocs" % "groupdocs-rewriter-cloud" % "24.12"
Java SDK for GroupDocs.Rewriter Cloud
GroupDocs.Rewriter Cloud SDK for Java is a simple Python SDK that enables your cloud Apps to perform paraphrasing, simplification, summarization and paraphrasing detection of Microsoft Word®, OpenOffice, Markdown, HTML and Adobe Acrobat® PDF documents as well as plain text by adding just a few lines of code.
In other words, it’s a SDK for document and plain text rewriting, summarization, etc. in our Cloud, that supports paraphrasing of .doc, .docx, .docm, .pdf, .rtf, .odt, .md, .html, .txt files. Just pass a specific file or text to the GroupDocs.Rewriter Cloud API, and it will process and save result in our Cloud or will return resulting text.
It is easy to get started with GroupDocs.Rewriter Cloud and there is nothing to install. Create an account at GroupDocs Cloud and get your application information, then you are ready to use SDKs.
Cloud Features
- Paraphrasing / summarization / simplification / paraphrase detection of documents
- Paraphrasing / summarization / simplification / paraphrase detection / comparison of plain text
- Words and idioms synonyms finder
- Return resulting text in response
- Save processed file in cloud
- No need to install any 3rd party software
Supported Document Formats
You can specify format of document to process putting in the request’s body:
- Microsoft Word®: DOC, DOCX, DOCM
- Adobe®: PDF
- Markdown: MD
- HTML: HTML
- Other: RTF, ODT, TXT
Additionally, user could obtain processed file in any other format available for conversion. Just specify output format of paraphrased document by putting file extension in the request’s body:
- doc, docx — docx, rtf, html, odt, txt, md, pdf, tiff, svg, xps
- pdf — docx, pptx, html, svg, xps
- html — md, pdf, docx, tiff, xps
Please visit Supported Formats for details.
Supported Languages
- ar — to process Arabic text or document
- de — to process German text or document
- en — to process English text or document
- es — to process Spanish text or document
- fr — to process French text or document
- id — to process Indonesian text or document
- ru — to process Russian text or document
- uk — to process Ukrainian text or document
- sk — to process Slovak text or document
- pt — to process Portuguese text or document
- it — to process Italian text or document
- hi — to process Hindi text or document
- th — to process Thai text or document
How to use the SDK?
Our API is completely independent of your operating system, database system, or development language. You can use any language and platform that supports HTTP to interact with our API. However, manually writing client code can be difficult, error-prone, and time-consuming. Therefore, we provide and support SDKs in many development languages to make it easier for your Cloud Apps to integrate with us.
Requirements
Building the API client library requires:
- Java 1.8+
- Maven (3.8.3+)/Gradle (7.2+)
Installation
To install the API client library to your local Maven repository, simply execute:
mvn clean install
To deploy it to a remote Maven repository instead, configure the settings of the repository and execute:
mvn clean deploy
Refer to the OSSRH Guide for more information.
Maven users
Add this dependency to your project’s POM:
<dependency>
<groupId>com.groupdocs</groupId>
<artifactId>GroupDocs-rewriter-cloud</artifactId>
<version>24.4</version>
<scope>compile</scope>
</dependency>
Gradle users
Add this dependency to your project’s build file:
repositories {
mavenCentral() // Needed if the 'GroupDocs-rewriter-cloud' jar has been published to maven central.
mavenLocal() // Needed if the 'GroupDocs-rewriter-cloud' jar has been published to the local maven repo.
}
dependencies {
implementation "com.groupdocs:GroupDocs-rewriter-cloud:24.4"
}
Others
At first generate the JAR by executing:
mvn clean package
Then manually install the following JARs:
target/GroupDocs-rewriter-cloud-24.4.jar
target/lib/*.jar
Quickstart
1. Get Started
It is easy to get started with GroupDocs.Rewriter Cloud. Simply, create an account at GroupDocs Cloud and get your application information, then you are ready to use the SDKs.
2. Run Demo
- Checkout the SDK
- Open Demo.java
- Set Your ClientId & ClientSecret
- Run
Rewrite plain text
package com.groupdocs;
// Import classes:
import com.groupdocs.model.*;
import org.openapitools.client.api.ParaphraseApi;
public class Demo {
public static void main(String[] args) {
String basePath = "https://api.groupdocs.cloud/v2.0/rewriter";
// Get Client Id and Client Secret from https://dashboard.groupdocs.cloud
String cliendId = "YOUR_CLIENT_ID";
String clientSecret = "YOUR_CLIENT_SECRET";
// Create instance of the API
ApiClient defaultClient = new ApiClient(basePath, cliendId, clientSecret, null);
ParaphraseApi apiInstance = new ParaphraseApi(defaultClient);
String s = "TEXT_TO_PARAPHRASE";
ParaphraseTextRequest request = new ParaphraseTextRequest();
request.setLanguage("en");
request.setText(s);
try {
StatusResponse response = apiInstance.paraphraseTextPost(request);
String response_id = response.getId();
if (!response.getStatus().toString().equals("BadRequest")){
while (true){
ParaphraseTextResponse paraphraseTextResponse = apiInstance.paraphraseTextRequestIdGet(response_id);
if (paraphraseTextResponse.getStatus().toString().equals("OK")) {
System.out.println(paraphraseTextResponse);
break;
}
try {
Thread.sleep(2000);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
} catch (ApiException e) {
System.err.println("Exception when calling ParaphraseApi#paraphraseTextPost");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Documentation for API Endpoints
All URIs are relative to https://api.groupdocs.cloud/v2.0/rewriter
Class | Method | HTTP request | Description |
---|---|---|---|
DetectApi | detectDocumentPost | POST /detect/document | Detect paraphrasing in the document |
DetectApi | detectDocumentRequestIdGet | GET /detect/document/{requestId} | Return document detection status. Also return probability of paraphrasing for the whole document and per paragraph |
DetectApi | detectDocumentTrialPost | POST /detect/document/trial | Trial detect paraphrasing in the document |
DetectApi | detectHcGet | GET /detect/hc | Health check for detect all services. |
DetectApi | detectTextPost | POST /detect/text | Detect paraphrasing in text |
DetectApi | detectTextRequestIdGet | GET /detect/text/{requestId} | Return text detection status. Also return probability of paraphrasing for the whole text |
DetectApi | detectTextTrialPost | POST /detect/text/trial | Trial detect paraphrasing in text |
FileApi | fileUploadPost | POST /file/upload | |
InfoApi | infoAvailableLanguagesGet | GET /info/availableLanguages | |
ParaphraseApi | paraphraseDocumentPost | POST /paraphrase/document | Paraphrase document |
ParaphraseApi | paraphraseDocumentRequestIdGet | GET /paraphrase/document/{requestId} | Return document rewriting status. Also return URLs for downloading of rewritten document if paraphrasig was successful |
ParaphraseApi | paraphraseDocumentTrialPost | POST /paraphrase/document/trial | Trial paraphrase document |
ParaphraseApi | paraphraseHcGet | GET /paraphrase/hc | Health check for all paraphrase services. |
ParaphraseApi | paraphraseSupportedConversionsGet | GET /paraphrase/supportedConversions | |
ParaphraseApi | paraphraseTextPost | POST /paraphrase/text | Rewrite text |
ParaphraseApi | paraphraseTextRequestIdGet | GET /paraphrase/text/{requestId} | Return text rewriting status. Also return rewritten text if paraphrasing was successful |
ParaphraseApi | paraphraseTextTrialPost | POST /paraphrase/text/trial | Trial rewrite text |
SimplifyApi | simplifyDocumentPost | POST /simplify/document | Simplify document |
SimplifyApi | simplifyDocumentRequestIdGet | GET /simplify/document/{requestId} | Return document simplifying status. Also return URLs for downloading of simplified document if paraphrasig was successful |
SimplifyApi | simplifyDocumentTrialPost | POST /simplify/document/trial | Trial simplify document |
SimplifyApi | simplifyHcGet | GET /simplify/hc | Health check for all simplify services. |
SimplifyApi | simplifySupportedConversionsGet | GET /simplify/supportedConversions | |
SimplifyApi | simplifyTextPost | POST /simplify/text | Simplify text |
SimplifyApi | simplifyTextRequestIdGet | GET /simplify/text/{requestId} | Return text simplifying status. Also return simplified text if paraphrasing was successful |
SimplifyApi | simplifyTextTrialPost | POST /simplify/text/trial | Trial simplify text |
SummarizeApi | summarizeDocumentPost | POST /summarize/document | Summarize document |
SummarizeApi | summarizeDocumentRequestIdGet | GET /summarize/document/{requestId} | Return document summarizing status. Also return URLs for downloading of summarized document if summarization was successful |
SummarizeApi | summarizeDocumentTrialPost | POST /summarize/document/trial | Trial summarize document |
SummarizeApi | summarizeHcGet | GET /summarize/hc | Health check for all summarize services. |
SummarizeApi | summarizeSupportedConversionsGet | GET /summarize/supportedConversions | |
SummarizeApi | summarizeTextPost | POST /summarize/text | Summarize text |
SummarizeApi | summarizeTextRequestIdGet | GET /summarize/text/{requestId} | Return text summarizing status status. Also return rewrote text if translation was successful |
SummarizeApi | summarizeTextTrialPost | POST /summarize/text/trial | Trial summarize text |
SwaggerApi | swaggerSpecGet | GET /swagger/spec | |
SynonymizeApi | synonymizeHcGet | GET /synonymize/hc | Health check for all synonymizer services. |
SynonymizeApi | synonymizeTextPost | POST /synonymize/text | Synonymize word |
SynonymizeApi | synonymizeTextRequestIdGet | GET /synonymize/text/{requestId} | Return text synonymizing status. Also return list of synonyms if it was successful |
SynonymizeApi | synonymizeTextTrialPost | POST /synonymize/text/trial | Trial synonymize word |
Documentation for Models
BaseTextRequest
,CloudTextRequest
,DegreeEnum
,DetectionFileRequest
,DetectionFileResponse
,DetectionTextRequest
,DetectionTextResponse
,DetectionTrialFileRequest
,FileSavingMode
,HealthCheckInfo
,HealthCheckResponse
,HttpStatusCode
,LanguageInfo
,Model
,Opt
,ParaphraseFileRequest
,ParaphraseFileResponse
,ParaphraseTextRequest
,ParaphraseTextResponse
,ParaphraseTrialFileRequest
,SimplifyFileRequest
,SimplifyFileResponse
,SimplifyTextResponse
,SimplifyTrialFileRequest
,StatusResponse
,SummarizationFileRequest
,SummarizationFileResponse
,SummarizationTextRequest
,SummarizationTextResponse
,SummarizationTrialFileRequest
,SupportedConversionsFormats
,SynonymizeTextRequest
,SynonymizeTextResponse
,Tokenizer
,TrialSupportedFormats