GroupDocs.Translation API を基盤とした.NETアプリケーションを作成し、技術的な詳細ではなくビジネスロジックに注力できます。
無料トライアルを開始GroupDocs.Translation は、テキスト、ドキュメント、画像、字幕、リソースのリアルタイム機械翻訳を提供します。高度な機械学習アルゴリズムと洗練されたニューラルネットワークにより、プロの人間翻訳者に近い品質を実現しながら、はるかに高速かつコスト効率的です。GroupDocs がホストする高性能クラウドサーバ上で動作し、PDF、Microsoft Office、OpenOffice ドキュメント、Markdown ファイル、そして .NET リソースを、46 の欧州・中東・アジア言語(計 128 の言語ペア)に翻訳できます。API はテキストの翻訳だけでなく、メタデータ、構造、スタイル、レイアウトを正確に保持します。
この SDK は、.NET コードと GroupDocs.Translation Cloud サービスとの連携を大幅に簡素化し、技術的な詳細ではなくビジネスロジックに集中できるようにします。接続の確立、API リクエストの送信、レスポンスの解析といった日常的な処理をすべて処理し、これらのタスクを任意の .NET アプリケーションで利用できる数個のシンプルなメソッドにラップします。.NET SDK、デモアプリケーション、ドキュメント、サンプルはすべて MIT ライセンスの下でオープンソースとして配布されています。あらゆる目的で使用でき、コードの任意の部分を変更することが可能です。
GroupDocs.Translation Cloud SDK for .NET は、詳細な開発者ガイドとライブコード例が付属しており、すぐに API 機能の利用を開始できます。まず、GroupDocs Cloud で無料アカウントを作成し、APP SID & Key information を取得して GroupDocs Cloud API と通信すれば、SDK をすぐにご利用いただけます。
GroupDocs.Translation Cloud は、あらゆる言語やプラットフォームと簡単に統合できる REST API で、HTTP のリクエストとレスポンスを管理できます。Google Cloud、Drive、DropBox、Amazon S3 などの主要なクラウドストレージサービスを依存関係なしで利用できます。
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Threading;
using GroupDocs.Translation.Cloud.Sdk.Api;
using GroupDocs.Translation.Cloud.Sdk.Client;
using GroupDocs.Translation.Cloud.Sdk.Client.Auth;
using GroupDocs.Translation.Cloud.Sdk.Extensions;
using GroupDocs.Translation.Cloud.Sdk.Model;
using HttpStatusCode = System.Net.HttpStatusCode;
namespace GroupDocs.Translation.Cloud.Sdk
{
public class TextTranslator
{
public TextTranslator()
{
Configuration config = new Configuration();
/** Authorize your requests to GroupDocs.Translation Cloud */
config.OAuthFlow = OAuthFlow.APPLICATION;
config.OAuthClientId = "YOU_CLIENT_ID";
config.OAuthClientSecret = "YOU_CLIENT_SECRET";
/** Initialize GroupDocs.Translation API */
config.BasePath = "https://api.groupdocs.cloud/v2.0/translation";
TranslationApi apiInstance = new TranslationApi(config);
/** Specify translation parameters */
string translateFrom = new List<string>() { "Hello, world! I can read this text in my language." };
string sourceLanguage = "en";
var targetLanguages = new List<string>() { "de" };
var request = new TextRequest(
sourceLanguage: sourceLanguage,
targetLanguages: targetLanguages,
texts: translateFrom);
/** Send text to translation */
StatusResponse translationStatus = apiInstance.TextPost(request);
/** Wait for results from translation queue */
if(translationStatus.Status.ToSystemHttpStatusCode() == HttpStatusCode.Accepted)
{
while(true)
{
var result = apiInstance.TextRequestIdGet(statusResponse.Id);
if(result.Status.ToSystemHttpStatusCode() == HttpStatusCode.OK)
{
Console.WriteLine(result.Translations[toLang].First());
break;
}
Thread.Sleep(1000);
}
}
}
}
}
GroupDocs.Translation Cloud API は SSL に保護されており、認証リクエストには署名と AppSID クエリパラメータ、または OAuth 2.0 認可ヘッダーが必要です。