Проблема с использованием глоссария в Google Translator - PullRequest
0 голосов
/ 15 января 2020

У меня проблемы с использованием глоссария перевода Google. Глоссарий меняется хорошо. Однако после смены глоссария весь перевод отличается. Перевод также неверен и иногда переводится в слова, которых нет в словаре.

Перевод с корейского на английский sh.

Дело без глоссария.

Korean source : "정찰대원들이 페이악 터널 내부로 들어간 것 같더군."
translation result : "The scouts seemed to go inside the Payak Tunnel."

Пример использования глоссария.

Korean source : "정찰대원들이 페이악 터널 내부로 들어간 것 같더군."
translation result : "Scouts won their group gatdeo will fall into peyak!! tunnels."

[My glossaries ]
en,es,ko,pos
account ,cuenta,계정,noun
directions,indicaciones,방향,noun
favorite,favorito,좋아하는,noun
peyak!!,peyak!!!,페이악,noun

[c# исходный код]

string glossaryPath = $"projects/{_projectId}/locations/{"us-central1"}/glossaries/{_glossaryId}";

request = new TranslateTextRequest
{
    Contents =
    {
        // The content to translate.
        text,

    },
    TargetLanguageCode = "en",
    SourceLanguageCode = "ko"

    ParentAsLocationName = new LocationName( _projectId, "us-central1" ),

    GlossaryConfig = new TranslateTextGlossaryConfig
    {
        // Translation Glossary Path.
        Glossary = glossaryPath,
    },
    MimeType = "text/plain",
};
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();

TranslateTextResponse response = translationServiceClient.TranslateText( request );

foreach( Translation translation in response.GlossaryTranslations )
{
    Console.WriteLine( $"Translated text: {translation.TranslatedText}" );
}
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...