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

Translation for words present in both languages not working correctly #1

Open
Ruko2010 opened this issue Jan 30, 2019 · 3 comments
Open

Comments

@Ruko2010
Copy link

If you have an input word that is present in both languages, the result is not as expected.
For Example:
dict de en test
should output the english translation of test. But it outputs the german ones first:
image

If I switch both languages the result stays the same:
dict en de test
image

Is this an API issue of dict.cc, or a workflow problem?

@natterstefan
Copy link

natterstefan commented Jun 8, 2020

Hi @Ruko2010, were you able to resolve this?

@Ruko2010
Copy link
Author

Ruko2010 commented Jun 8, 2020

Sorry, I tried nothing. I was waiting for a response here, so no, no solution yet.

@dennis-tra
Copy link
Owner

Hi @Ruko2010,

sorry for the late reply. I didn't have notifications enabled for this repo and I'm not checking in that often. Now I'm watching all activity.

Unfortunately the order of languages you're specifying doesn't influence the output. It just indicates in which languages you're interested.

Under the hood the workflow just calls https://www.dict.cc/?s={your-word} and parses the HTML. The page has two columns and to display the results I'm using a simple heuristic. If the word you've entered appears more often in the left column then that's probably the source-language and you're interested in the right results (the target-language).

Now if you're opening https://www.dict.cc/?s=test you see that the left column contains more direct matches to the word test, so the right column will be printed bold as the result.

Is it possible to fix this? Definitely. I'm happy with the 80:20 approach of the simple heuristic, though.

If anyone is interested in improving this workflow I'm more than happy to accept contributions.

Best,
Dennis

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants