-
Notifications
You must be signed in to change notification settings - Fork 83
Expand file tree
/
Copy pathITranslator.cs
More file actions
42 lines (38 loc) · 1.1 KB
/
ITranslator.cs
File metadata and controls
42 lines (38 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
using Waher.Runtime.Inventory;
namespace Waher.Runtime.Language
{
/// <summary>
/// Interface for language translators
/// </summary>
public interface ITranslator : IProcessingSupport<string>
{
/// <summary>
/// If the translator can detect language or not.
/// </summary>
bool CanDetectLanguage
{
get;
}
/// <summary>
/// What languages are supported by the translator.
/// </summary>
string[] SupportedLanguages
{
get;
}
/// <summary>
/// Tries to detect the language used in the provided text.
/// </summary>
/// <param name="Text">Natural language text.</param>
/// <returns>Language code of detected language, or empty string if not detected.</returns>
string DetectLanguage(string Text);
/// <summary>
/// Translates natural language text, from one language to another.
/// </summary>
/// <param name="Text">Text to translate.</param>
/// <param name="FromLanguage">From language</param>
/// <param name="ToLanguage">To language</param>
/// <returns>Translated text.</returns>
string Translate(string Text, string FromLanguage, string ToLanguage);
}
}