-5

I'm not very advanced at Java so I don't know how to go about doing this at all. I'd appreciate some pointers or a guide so I can learn. Thanks in advance. Here is my problem:

public static void main (String [] args ){

    ArrayList Heaven = new ArrayList(); 
    Heaven.add("heaven"); 
    Heaven.add("seven"); 
    Heaven.add("eleven"); 
    Heaven.add("7-11");
}

I don't want to spend my time typing out all the rhymes for a particular word. Is there a quicker way to do this?

Preferably a way of harvesting the information from this page: http://www.rhymezone.com/r/rhyme.cgi?Word=heaven&typeofrhyme=perfect&org1=syl&org2=l&org3=y

Albert
  • 1,156
  • 1
  • 15
  • 27

2 Answers2

0

If you don't already have a list of rhyming words, you will just have to enter them all like that (or put them all in a config file of some kind and read that in), but either way you're just typing them all in.

What you are calling harvesting from rhymezone is called scraping. You can check here: Web scraping with Java for the best way to scrape pages with Java. I would also check with rhymezone about their policy on scraping, or if maybe they provide an API (official way to grab their data).

Also if you're scraping their website for that kind of information, you will probably want to scrape the data for a word, and store that somewhere, so you aren't scraping their page every time you want to look up a word.

Community
  • 1
  • 1
xbakesx
  • 13,202
  • 6
  • 48
  • 76
0

you need to use JSOUP API,mix it with htmlcleaner API that will give you good way to go through out your DOM tree and get the information you want by using JSOUP selector.

Alaa Abuzaghleh
  • 1,023
  • 6
  • 11