Java Java: create a dictionary/ vocab list

  • Thread starter Thread starter LindaS
  • Start date Start date
  • Tags Tags
    Java List
Click For Summary
To retrieve definitions from dictionary.com, a web-based scripting approach is recommended for parsing web pages and making requests. First, compile a list of words to search for, which can be sourced from a standard text file. Dictionary.com has a predictable URL structure (http://www.dictionary.com/browse/word) that can be leveraged for direct access to definitions. In Java, the process involves establishing a connection to fetch the web page, organizing the content into a manageable structure, searching for the desired information, and extracting it for use in your application. While Java can be used, alternatives like C++ or VB may also be considered. Existing resources, such as a code snippet for retrieving definitions, and SOAP-based web services are available to simplify the task.
LindaS
Messages
3
Reaction score
0
Is there a way I can get the definitions from, say, dictionary.com?
Does much method already exist or do I have to go about creating one? How would I get a specific something from a specific website?

I prefer using java, but if there's another language that makes it easier, I also know C++ and VB.
 
Technology news on Phys.org
LindaS said:
Is there a way I can get the definitions from, say, dictionary.com?
Does much method already exist or do I have to go about creating one? How would I get a specific something from a specific website?

I prefer using java, but if there's another language that makes it easier, I also know C++ and VB.

You are probably better off using a web-based scripting system to not only parse a web-page, but to also do the searching and web-page request if you need to.

But in order to do this, you will need to first get the list of words you want to search for. For this you will need to download a standard text file or equivalent that contains just the terms and then use this in your script to search for the definition or if the website has a standard structure (like Wikipedia), you can just load the page directly and then parse the contents directly.

After looking at dictionary.com, it does look like it has a standard address structure like Wikipedia in the form of http://www.dictionary.com/browse/word where word is the word you are looking for.

If you wanted to do it in Java, you need the following routines:

a) Make a connection to get the contents of a particular web-page
b) Take the web-page and put it into some kind of structure like a graph or some more useful graph/other hybrid structure
c) A way to search for the particular content you need
d) A way to extract the structure you are searching for so that you can parse it easily and put it in another structure for your specific application.

I haven't used Java in a very long time, but I imagine that routines should exist to do this kind of thing at least somewhere.
 
Learn If you want to write code for Python Machine learning, AI Statistics/data analysis Scientific research Web application servers Some microcontrollers JavaScript/Node JS/TypeScript Web sites Web application servers C# Games (Unity) Consumer applications (Windows) Business applications C++ Games (Unreal Engine) Operating systems, device drivers Microcontrollers/embedded systems Consumer applications (Linux) Some more tips: Do not learn C++ (or any other dialect of C) as a...

Similar threads

Replies
1
Views
2K
Replies
3
Views
3K
  • · Replies 5 ·
Replies
5
Views
3K
Replies
86
Views
1K
  • · Replies 3 ·
Replies
3
Views
6K
Replies
2
Views
2K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 14 ·
Replies
14
Views
3K
Replies
21
Views
13K
  • · Replies 6 ·
Replies
6
Views
2K