Einenlum / linguee-api

Linguee crawler written in PHP
MIT License
1 stars 0 forks source link

Shouldn't it work with non-ASCII characters. #3

Closed kurt-krueckeberg closed 2 years ago

kurt-krueckeberg commented 2 years ago

This doesn't work

<?php
use Einenlum\LingueeApi\Factory;
include "vendor/autoload.php";

$linguee = Factory::create();
$response = $linguee->translate('Zucker', 'ger', 'eng'); // Works
 print_r ($response->toArray());

$response = $linguee->translate('vernachlässigen', 'ger', 'eng'); // <-- Fails. Passing German characters like ä, ö, ü, and ß fails
 print_r ($response->toArray());

It fails with

PHP Fatal error:  Uncaught Error: Call to undefined method Symfony\Component\DomCrawler\Crawler::getText() in /home/kurt/temp/vendor/einenlum/linguee-api/src/Response/Transformer/Word/Translations.php:74
Einenlum commented 2 years ago

Thanks for your feedback. I'm working on it. Hope to fix it soon.

Einenlum commented 2 years ago

Just fixed it in v0.1.1.

Should work now. Thanks for your feedback, and please open another issue if you find another problem :wave:.

kurt-krueckeberg commented 2 years ago

Yes, it seems to be working now. Thanks a lot. This is really something helpful to me.