Luny
Back

Slang Dictionary

An assignment in the course of Java Programming to construct a SwingUI Java application for a dictionary.

Published on
Updated on

4.315

java

Overview

This is probably a very nothing in your eyes once you read that it’s an assignment for a university course. But that’s your first mistake, to underestimate the almighty Luny.

Takeaways

Main takeaways of this project are:

Description

This project focuses more on IO, OOP, Generics and Collections.

Required Tasks

  1. Must utilize Java IO, OOP, and Collections. The application can use Console, Swing or Java FX.
  2. Must have a menu to pick an option, regardless of UI choices.
  3. Must load data from files into objects.
  4. Must have a search time under 1s for 100.000 words, even though the provided default file doesn’t have that many.
  5. Must save the current data after modifications.
  6. Must use a version control system, with at least 10 commits spread across multiple days.

Screenshots

Main Screen

Create New Dictionary

View Screen

Quiz Start Screen

Quiz Screen

Features

Required Features

  1. Find by the word.
  2. Find by the definition.
  3. View search history.
  4. Add a new word. Notify if duplicated, and allow overwriting or adding new.
  5. Edit a word.
  6. Delete a word, with confirmation.
  7. Reset back to default list.
  8. Randomly select a word and display it as the “Word of the Day”.
  9. Quiz Feature that shows a word, and picks a definition.

All Features

Databases

This application uses multiple databases, so you can effectively have multiple types of dictionaries, maybe one for English slangs, one for German slangs and one for Russian slangs. Only one database is loaded and viewed at one time to prevent loading too many entries into the memory, as the entire dictionary loads in memory.

FeatureNameAction
file.openOpen DatabaseOpen an existing database, usually under the name <uuid>.dict.
file.newCreate DatabaseCreate a new database bound to a file, with options to bootstrap the database with default values, like the 7,000 slang words dictionary or the randomly generated 100,000 entries dictionary for testing.
file.closeClose DatabaseClose the database after asking if the user wants to save any changes.
file.reloadReload DatabaseDrop all changes and reload the database from the file, if it still exists.
file.saveSave DatabaseSave all changes done to the currently opened database.
file.bombBomb DatabaseNuke all entries on the database. To save this change, use the file.save feature.
file.resetReset DatabaseReset the database back into default entries.
file.renameRename DatabaseRename the database, but the file name shouldn’t be changed.

Editing

This section provides actions to manipulate the dictionary.

FeatureNameAction
edit.addAdd a wordAppends a new entry into the dictionary.
edit.editEdit a wordEdits an entry’s word or definition.
edit.starFavorite a wordMarks a word as favorite and prevents its deletion. You can mark multiple at once.
edit.unstarUnfavorite a wordUnmarks a word from faovirte and allows its deletion. You can unmark multiple at once.
edit.lockLock a wordLocks a word and prevents it from edits. You can lock multiple at once.
edit.unlockUnlock a wordUnlocks a word and allows it to be edited. You can unlock multiple at once.
edit.removeRemove a wordDeletes a word from the dictionary.

Searching

This application provides multiple ways to customize your searches.

FeatureNameAction
search.sortSort FavoritesAbility to sort favorite words to top, to bottom, hidden, only show favorites or in an ordinary order with other words.
search.instantInstant SearchAbility to search as you type using Swing Workers.
search.matchMatch SearchesAbility to pick whether the search should match against words or definitions, or casings or uses the search text as a regex.
search.randomRandom WordSee the word of the day, and ability to request a new word. Ability to see a certain message if there is nothing within the database.
search.historyView Search HistoryYou can see what words were queried, how many results returned, how much time elapsed and when that query happened.

Quiz

The quiz is formatted in a way, so that your goal would be to go for the highest score possible. Score is affected by your Combo Stack, which goes up by how many answers you get correct in a row. The higher your combo goes, the higher your multiplier scales. But be aware, one wrong answer will collapse your multiplier back to 1x.

There are partners, acting as lifelines, you can choose up to 4, each having a unique one-time use ability that may help planning to max out your score gain: