Results 1 to 40 of 82

Thread: Adding a dictionary instead of a list

Threaded View

  1. #39

    Thread Starter
    Lively Member
    Join Date
    Nov 2015
    Posts
    114

    Re: Adding a dictionary instead of a list

    Code:
    1. CheckWordFromTheDictionaryFunction()
    2. MoveNextFunction ()

    Step .1
    OnButtonClick_Event

    Code:
    3.1. Raise the event that will trigger the CheckWordFromTheDictionaryFunction.
    Step. 1.A.
    Duties: - CheckWordFromTheDictionaryFunction
    Code:
    1. To strickly check if the currentword is in the dictionary or not. But it should not move next!
    Instructions:

    Code:
    (1.) To check if the RichTextBox is Not Null, 
    if it is Null, quit. MessageBox.Show("You have no words to check!")
    (2.) ElseIf Not Null, 
    	(A.) Check if the Currentword is in the dictionary
    If the Currentword is found, 
    	(B.) take the words from the second column, and store them into a CurrentSuggestions Variable.
    ElseIf the Currentword from the RichtextBox is not found, call the MoveNextFunction to move to the NextwordIndex.
    Step .1 .B
    Duties:- MoveNextFunction

    Code:
    1. To strickly move to the NextwordIndex without doing anything else!
    Instructions
    Code:
    1.1  The MoveNextFunction will move to the NextwordIndex of the RichTextBox, and then call the CheckWordFromTheDictionaryFunction.
    	1.3. If the CheckWordFromTheDictionaryFunction does not find the Currentword that has been moved to, it will call the MoveNextFunction to move to the NextwordIndex.
    Step. 2
    Code:

    Code:
    If the Currentword was found. 
    	2.1. Highlight the Currentword to be replaced.
    Clear the ContextMenuStrip.Clear() because of repetitive tasks, and
    	2.2. Load the items from the CurrentSuggestions variable into the ContextMenuStrip.
    Step. 3
    Code:
    3.2. If no Currentword was found from the dictionary in the whole document by the CheckWordFromTheDictionaryFunction after the MoveNextFunction was called.
    	A messageBox.Show() function will be shown with("No Matches were found from the dictionary in the whole document!"). 
    	When the user clicks the OK button of the MessageBox.Show()
    The CheckWordFromTheDictionaryFunction should be stopped without closing the whole program. Otherwise, there is already a Me.Close() function on the BtnClose Button.
    Hence, here the program is ideal.

    Step .4
    Code:
    If Currentword was found, display the ContextMenuStrip, and allow the user to select what he or she wants.
    ElseIf the Currentword was not good. The MoveNextFunction will be called.
    ElseIf the CurrentSuggestions are good. Replace the Currentword with CurrentSelectedSuggestion Item from the contextMenuStrip.
    Step. 5
    Code:

    Code:
    It will now wait for the User to click the button again for the CheckWordFromTheDictionaryFunction to be called. We have agreed that the CheckWordFromTheDictionaryFunction is to check the Currentword from where it has been moved to! 
    ElseIf all the replacements have been made, MessageBox.Show("The task is Completed."). End.
    Terminologies

    Code:
    1. The CheckWordFromTheDictionaryFunction is the function to do the checking.
    2. The MoveNextFunction is in charge of moving to the NextwordIndex.

    Keywords to be used in the program:
    Code:
    Currentword, CurrentSuggestions Variable, NextwordIndex, CurrentSuggestions, CurrentSelectedSuggestion Item
    Items to be created:
    Code:
    Button for search, Button for Close, ContextMenuStrip1, RichTextBox1, Connection to a Dictionary path.
    Functions to be created
    Code:
    1. CheckWordFromTheDictionaryFunction
    2. MoveNextFunction
    Last edited by nqioweryuadfge; Dec 23rd, 2015 at 08:36 AM.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width