Docsity

Comprehensive Software Engineering Homework Solutions, Exercises of Software Engineering

Toggle sidebar
bg1
Introduction to Software Engineering
Homework Assignment 4
Kristine Rakviashvili
November 10, 2025
1.
The secret (hidden information) is how words are stored, matched, and
corrected inside each dictionary implementation (FullFormDictionary,
StemFormDictionary, IdentifiersDictionary).
The uml diagram uses strategy pattern. The WordModel handles session
storage, while the dictionarys handle permanent words. The text editor has
to call functions to get recommendations (spell, autocorrect) from word
model. it notifys the wordmodel of user's choice.
<<Interface>> Dictionary
/**
* Adds a new word to the dictionary.
*
* @param word the word to add
*/
void addWord(String word);
/**
* Looks up similar words in the dictionary.
*
* @param word the word to look up
* @return a list containing the word if found, or a list of similar
words otherwise
*/
pf3
pf4
pf5

Partial preview of the text

Download Comprehensive Software Engineering Homework Solutions and more Exercises Software Engineering in PDF only on Docsity!

Introduction to Software Engineering Homework Assignment 4 Kristine Rakviashvili November 10, 2025

The secret (hidden information) is how words are stored, matched, and corrected inside each dictionary implementation (FullFormDictionary, StemFormDictionary, IdentifiersDictionary). The uml diagram uses strategy pattern. The WordModel handles session storage, while the dictionarys handle permanent words. The text editor has to call functions to get recommendations (spell, autocorrect) from word model. it notifys the wordmodel of user's choice. <> Dictionary /**

  • Adds a new word to the dictionary.
  • @param word the word to add / void addWord(String word); /*
  • Looks up similar words in the dictionary.
  • @param word the word to look up
  • @return a list containing the word if found, or a list of similar words otherwise */

List lookup(String word); /**

  • Finds words that start with the specified prefix.
  • @param prefix the prefix to search for
  • @return a list of words starting with the given prefix / List prefix(String prefix); /*
  • Checks if this dictionary contains the specified word.
  • @param word the word to check
  • @return true if this dictionary contains the specified word, false otherwise / boolean contains(String word); <> WordModel /*
  • Loads and saves the specified dictionary into the model.
  • @param dictionary the dictionary to add to the model / void saveDictionary(Dictionary dictionary); /*
  • Returns a list of words for spelling correction.
  • @param word the word to check for spelling errors
  • @return a list containing the word itself if correctly spelled, or similar words otherwise / List spellCorrection(String word); /*

<> TextEditor /**

  • Called when text input changes.
  • Triggers word completion for autocompletion. / void onInput(); /*
  • Called when a word is completed (e.g., when a space or punctuation is typed).
  • Triggers spell checking. / void onWordEnd(); /*
  • Called when the user chooses a word recommendation.
  • The choice is saved in the WordModel. */ void notifyChoice();