19

Having recently come across wordlist and wordnet, two great discoveries on their own, I'm now looking for a similar tool, if simpler, that will take the bare infinitive of a verb and return the simple past and past participle. Example:

$ verbteacher throw

Simple past: threw
Past participle: thrown

Does anybody know where to find verbteacher(1)?

sadpluto
  • 293

2 Answers2

23

Seems the easiest way is to write it yourself. At the first look I found pretty good website, that can give us all information we need. Thus all we need to do is to write a function that will parse it. So five minutes with bash and voila:

 $ function verbteacher() { 
    wget -qO - http://conjugator.reverso.net/conjugation-english-verb-$1.html | \
    sed -n "/>Preterite\|>Past</{s@<[^>]*>@ @g;s/\s\+/ /g;/e I/s/.* I \([^ ]*\) you .*/Simple past: \1/;/ Past/s/ Past /Past participle: /;p}" ; 
 }
 $ verbteacher go
Simple past: went
Past participle: gone 
 $ verbteacher throw
Simple past: threw
Past participle: thrown 

So you can put this function to your ~/.bashrc and use it until the site will change its structure. Hope it will never do it.

Obviously it won't work without the internet connection. Hope this is not critical for you.

rush
  • 27,403
  • Thank you! That will certainly do, though after discovering wordlist and wordnet I was hoping there was something fairly standard I didn't know about. – sadpluto Jul 04 '12 at 22:45
0

you could use a dictionary file of all the words in the English language. You could find one online. The you could alter the script file a little to get the word from the file and output it to a text file that would hold the output of the reference. Then use that file to make a new version of the function that uses that file/database to look them up.

the easiest way would be for the output of each term to be on it's own line with the results tabbed apart. then you would only need to char match the first word of each line making it more efficient.

If you do do this please upload the results an open source script/database as I think there are more that could benefit from this. I think it would be cool to integrate it with Libra Office and let it be used from the terminal as well.

Joe
  • 1,306