Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with -ido ending word #4

Open
ssoto opened this issue Sep 14, 2021 · 1 comment
Open

Issue with -ido ending word #4

ssoto opened this issue Sep 14, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@ssoto
Copy link

ssoto commented Sep 14, 2021

Hello guys,
I found a extrange behaviour trying to translate a word:

  from urllib.parse import urlencode
  import requests
  
  def translate_to_and(sentence, vaf):
       encoded_url_params = urlencode({"spanish": sentence, "vaf": vaf})
       response = requests.get(f"https://api.andaluh.es/epa?{encoded_url_params}")
       return response.json()
  
  es_sentence = "he sido yo"
  for vaf in ["ç", "z", "s", "h"]:
      print(translate_to_and(es_sentence, vaf))

The output of this piece of code is:

{'spanish': 'que ha sido eso', 'andaluh': 'que a çido eço', 'rules': {'vaf': 'ç', 'vvf': 'h', 'escapeLinks': False}}
{'spanish': 'que ha sido eso', 'andaluh': 'que a zío ezo', 'rules': {'vaf': 'z', 'vvf': 'h', 'escapeLinks': False}}
{'spanish': 'que ha sido eso', 'andaluh': 'que a sío eso', 'rules': {'vaf': 's', 'vvf': 'h', 'escapeLinks': False}}
{'spanish': 'que ha sido eso', 'andaluh': 'que a hido eho', 'rules': {'vaf': 'h', 'vvf': 'h', 'escapeLinks': False}}

As you can see, depending on vaf parameter the api return a result. Applying EPA rules, the response is correct for z and s vaf parameters and looks wrong for ç and h ones.

@ssoto ssoto added the bug Something isn't working label Sep 14, 2021
@ssoto
Copy link
Author

ssoto commented Sep 14, 2021

I tried to replicate this behaviour with other sentences

With me gusta mucho el cocido it works nice:

In [20]: sentence = "me gusta mucho el cocido"

In [21]: for vaf in ["ç", "z", "s", "h"]:
    ...:     print(translate_to_and(sentence, vaf))
    ...: 
{'spanish': 'me gusta mucho el cocido', 'andaluh': 'me gûtta muxo er coçío', 'rules': {'vaf': 'ç', 'vvf': 'h', 'escapeLinks': False}}
{'spanish': 'me gusta mucho el cocido', 'andaluh': 'me gûtta muxo er cozío', 'rules': {'vaf': 'z', 'vvf': 'h', 'escapeLinks': False}}
{'spanish': 'me gusta mucho el cocido', 'andaluh': 'me gûtta muxo er cosío', 'rules': {'vaf': 's', 'vvf': 'h', 'escapeLinks': False}}
{'spanish': 'me gusta mucho el cocido', 'andaluh': 'me gûtta muxo er cohío', 'rules': {'vaf': 'h', 'vvf': 'h', 'escapeLinks': False}}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant