LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Curl to get word translation (wordnet) and translation from CLI? (https://www.linuxquestions.org/questions/linux-general-1/curl-to-get-word-translation-wordnet-and-translation-from-cli-945632/)

Xeratul 05-17-2012 10:53 PM

Curl to get word translation (wordnet) and translation from CLI?
 
Hi,

I would like to know whether this would be possible, to use curl to get sthg similar to :
wn example -over

or translate a word from ex. one language to another one,
this using curl (or wget), linux, ....opensource, and for the command line output (cli)

thank you

cheesus 05-22-2012 04:22 PM

well, you can call "curl http://wordnetweb.princeton.edu/perl/webwn?s=drink" to search for drink,
but the HTML output might not help you.
"lynx http://wordnetweb.princeton.edu/perl/webwn?s=drink" (or w3m) would make sense...
Cheers, Tom.

romagnolo 05-23-2012 04:29 PM

Yes this is possible whether with curl or wget. With a small BASH script, you
a) ask for the input world;
b) compose the dictionary URL with the word parametrized;
c) access the URL and retrieve the webpage, parsing the html for static features around the portion of text that contains the translated word;
d) output to terminal the translation.

This is about 10 lines of BASH code.

Xeratul 05-24-2012 12:21 PM

Quote:

Originally Posted by romagnolo (Post 4685863)
Yes this is possible whether with curl or wget. With a small BASH script, you
a) ask for the input world;
b) compose the dictionary URL with the word parametrized;
c) access the URL and retrieve the webpage, parsing the html for static features around the portion of text that contains the translated word;
d) output to terminal the translation.

This is about 10 lines of BASH code.

That's really cool from them, from wordnet to leave the possibility to get the definition.

wow
gorgeous intentions from them


All times are GMT -5. The time now is 09:52 PM.