...

/

English-Spanish dictionary

English-Spanish dictionary

Let's build a simple application in Ruby to practice what we have covered so far.

We'll cover the following...

Let’s sum up everything we learned about hashes, arrays, and their combinations. We will build a minimalistic English to Spanish dictionary application. You can guess from the title which data structure we’ll be using: hash.

The most important thing here is a database. We will not use sophisticated database management systems like Postgres or MySQL. Instead, we’ll keep data organized in the data structure in the computer’s memory. It could look like this:

dict = {
  'cat' => 'gato',
  'dog' => 'perro',
  'girl' => 'chica'
}

We can also use any other data structure. In our case, it will be a set of key-value pairs, where the key is an English word in string_ type, and the value is the translation, a Spanish word string type.

Hash data structure allows us to perform ...