Skip to content
This repository was archived by the owner on Feb 23, 2024. It is now read-only.
This repository was archived by the owner on Feb 23, 2024. It is now read-only.

[google cloud translate] as a result of translation, the second sentence disappeared #9

@InspiringPeople

Description

@InspiringPeople

Environment details

  1. Specify the API at the beginning of the title (for example, "BigQuery: ...")
    Google Cloud Translate
  2. OS type and version
    Linux ANLZ-G1 4.4.0-130-generic Removing overloaded global "type" from storage.acl. google-cloud-python#156-Ubuntu SMP Thu Jun 14 08:53:28 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
  3. Python version and virtual environment information: python --version
    python 3.7
  4. google-cloud- version: pip show google-<service> or pip freeze
    google-cloud-translate==2.0.1

Steps to reproduce

  1. Translate the two sentences written in Korean without spaces after the special symbols (.,! ...) using the google cloud translate API.

Code example

# example
from google.cloud import translate_v2 as translate
translate_client = translate.Client()

# case 1
comments = '야 너 왜 자꾸 문제 생겨.자꾸 이러면 못써'
myTrans1 = translate_client.translate(comments, target_language = 'en')
print('case 1 : ',myTrans1['translatedText'])

# case 2
comments = '야 너 왜 자꾸 문제 생겨. 자꾸 이러면 못써'
myTrans2 = translate_client.translate(comments, target_language = 'en')
print('case 2 : ', myTrans2['translatedText'])

Result

case 1 : Hey, why do you keep having problems?
case 2 : Hey, why do you keep having trouble? If I keep doing this, I can't use it

This is 100% reproducible. It needs credential key (GOOGLE_APPLICATION_CREDENTIALS) because I use paid service (Google Cloud Translate V2)

The difference in input data is just whether there is a space after the period or not. However, as a result of translation, in case 2, the second sentence disappeared without being translated.

Metadata

Metadata

Assignees

Labels

🚨This issue needs some love.api: translationIssues related to the Cloud Translation API API.triage meI really want to be triaged.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions