src/PHPolyglot.php
public function lookup(string $text, string $languageFrom, string $languageTo = ''): DictionaryResponse
    {
        if ($languageTo) {
            $response = $this->getDictionaryApi()->getTranslateAlternatives(
                $text, //@codeCoverageIgnore
                new Language($languageTo),
                new Language($languageFrom)
            );
        } else {
            $response = $this->getDictionaryApi()->getTextAlternatives($text, new Language($languageFrom));
        }

        return $response;
    }
public function lookup(string $text, string $languageFrom, string $languageTo = ''): DictionaryResponse
    {
        if ($languageTo) {
            $response = $this->getDictionaryApi()->getTranslateAlternatives(
                $text, //@codeCoverageIgnore
                new Language($languageTo),
                new Language($languageFrom)
            );
        } else {
            $response = $this->getDictionaryApi()->getTextAlternatives($text, new Language($languageFrom));
        }

        return $response;
    }
public function lookup ( string $ text , string $ languageFrom , string $ languageTo = '' ) : DictionaryResponse { if ( $ languageTo ) { $ response = $ this -> getDictionaryApi ( ) -> getTranslateAlternatives ( $ text , //@codeCoverageIgnore new Language ( $ languageTo ) , new Language ( $ languageFrom ) ) ; } else { $ response = $ this -> getDictionaryApi ( ) -> getTextAlternatives ( $ text , new Language ( $ languageFrom ) ) ; } return $ response ; }
The most common use of `lookup` is look up of the word in the same language, that's
why the first language parameter of `lookup` method is language-from, language-to is optional,
which differs from the language parameters order for translation

@param string $text
@param string $languageFrom
@param string $languageTo

@return DictionaryResponse
The most common use of lookup is look up of the word in the same language that s why the first language parameter of lookup method is language - from language - to is optional which differs from the language parameters order for translation