What you have learned about data structures and algorithms

Assignment Help Software Engineering
Reference no: EM133697712

Programming

Assignment Brief
This part of the assignment is an extension of part 1. Whereas for part 1 we considered the correctness only, we are concerned with the efficiency for this part.

The brief for Assignment Part 1 is copied below for your convenience:

In many situations, we may need to find a word based on one or more letters in it. For example, when making or completing a crossword you may want to find a word that has 4 letters, starts with J and ends with A. In this assignment, the program you will write will create a lexicon of words from various text files.

A word is a sequence of letters. Words will be treated in a case-insensitive manner. A simple option is to store all the words in lower case. Initially, a word is obtained as a sequence of characters separated by whitespace characters. Then numbers and punctuation characters, if any, must be removed. More specifically:

If the word "and" occurs twice in the file, it is only stored once in the lexicon.
If the word "you" also occurs as "YOU", only one version is stored.
Punctuation, such as commas, quotes, hyphens, full stops and question marks, are removed.
Numeric characters are removed.
If the word "don't" or the word "second-hand" appears in the input texts, they will be stored without punctuation (i.e. "dont" and "secondhand" respectively).
The 'word' "1", for example, will be ignored as it contains all numeric characters.
For each word, we also keep the following information:

The frequency: How many times the word appears in the input files.
The list of neighbours: A neighbour of a word w is a word that is of the same length and differs from w by only one letter. For example, if the word w refers to "cat", then:
"cathy" is not w's neighbour, for they are not of the same length.
"man" is not w's neighbour, for they differ by more than one letter.
"can" is a neighbour of w
"fat" is a neighbour of w
"cot" is a neighbour of w.
In this part of the assignment, you will need to:

Read one text file and construct a lexicon that contains words from the file

Write the words (including spellings, frequencies and neighbours) from the lexicon to a text file

The format of the text file MUST be the same as in Part 1 of the assignment

You should only include one solution. It is entirely up to you which data structure(s) and/or sorting algorithm(s) will be used, as long as they are included in the subject; however, you must take the program's efficiency in consideration, as the test file is much larger in this part.
The steps required to complete this part of the assignment should be similar to what you did in part 1
To simplify the structure of this notebook, sections have been created for you to populate with parts of your solution. With that said, you are more than welcome to create any additional code blocks as you see fit, just make sure it is clear how it is relevant to your final solution. As you create your solution, make sure you test it as you go to ensure all components work.

Once you have completed this assignment, you will also need to write a brief report describing the data structures and/or sorting algorithms you selected.

Instructions
In this task you to write a function, build_lexicon(), that has two parameters, an input_filename and output_filename.

This function should:

Read all words from the file described by input_filename, constructing a lexicon with all words
Write all words, including spellings, frequencies and neighbours from the lexicon to the file described by output_filename.
This functionality should exactly match what was required in part 1 of the assignment. That is, when writing words to the text file,

The words must be written in sorted alphabetical order.
The information on each word, which is also written to the text file, includes the frequency and the list of its neighbours.
The list of neighbours must also be in alphabetical order.
Neighbours in the list of neighbours can either be written with or without quotation marks around them (refer to part 1 of the assignment).
To output each word, first the spelling of the word is displayed, followed by the frequency, and then followed by the word's neighbours (in alphabetical order, inside a pair of square brackets).

Use the provided sample files to check if the output of your program is correct.

You may implement as many additional functions, etc. as you see fit to implement this task (e.g. similar to part 1 of the assignment where you had functions to read the data, write the data, etc.).

We have provided code that will call your function and create an output text file. Calling your function in this way is how we will test if your solution works as expected. You may not modify this function call.

Purpose/Rationale
The purpose of this assignment is to get practice implementing an efficient solution to a task using data structures and algorithms that you have learned in the subject so far. This is an extension of Part 1 of the assignment.

Task Details
This assignment focusses on content relating to algorithms and data structures you have covered in this subject so far. You are expected to use what you have learned about data structures and algorithms to solve this assignment. In addition, it is expected that you have prior Python programming knowledge to successfully complete this assignment.

Instructions

This assignment takes the form of a notebook, much like those which you have already encountered during your lab sessions. You are required to read through the tasks in the notebook and place your solutions in the code cells as instructed in the notebook itself. In addition to the notebook. you are also required to submit a report that addresses some questions as detailed in the notebook.

Reference no: EM133697712

Questions Cloud

Identify factors that increase vulnerability of child : Identify factors that increase the vulnerability of a child. Utilize the nursing process in completing a comprehensive health history.
Explain the social implications of using biological science : Explain the social implications of using biological science theories in public health interventions. What are the pros and cons?
Explain what is meant by quality and safety in healthcare : Explain what is meant by quality and safety in healthcare in Australia, and the other country and Explain similarities and/or differences in the other country
How does foreign military training lead to norm transmission : According to Scharpf, is there any risk involved in foreign military training? If training is risky, why do it? Also, why do governments train military abroad?
What you have learned about data structures and algorithms : CSE2ALG Programming, La Trobe University - You are expected to use what you have learned about data structures and algorithms to solve this assignment
What happens if i forget an appointment : What happens if I forget an appointment? Is what I tell you confidential? What if I have an emergency? How will I know when our work is finished? 7) Wh
Prepare your referral summary for one service you think : HSV 340- After writing the case note, prepare your referral summary for one service you think would be beneficial to Greg.
Example of which critique of pacifism : In which one country fights another to protect those unable to defend themselves is an example of which critique of pacifism?
What obstacles may exist related to gaps in languages : How might this country resist emergency response assistance from the U.S.? What obstacles may exist related to gaps in languages?

Reviews

Write a Review

Software Engineering Questions & Answers

  Research report on software design

Write a Research Report on software design and answer diffrent type of questions related to design. Report contain diffrent basic questions related to software design.

  A case study in c to java conversion and extensibility

A Case Study in C to Java Conversion and Extensibility

  Create a structural model

Structural modeling is a different view of the same system that you analyzed from a functional perspective. This model shows how data is organized within the system.

  Write an report on a significant software security

Write an report on a significant software security

  Development of a small software system

Analysis, design and development of a small software system.

  Systems analysis and design requirements

Systems Analysis and Design requirements

  Create a complete limited entry decision table

Create a complete limited entry decision table

  Explain flow boundaries map

Explain flow boundaries map the dfd into a software architecture using transform mapping.

  Frame diagrams

Prepare a frame diagram for the software systems.

  Identified systems and elements of the sap system

Identify computing devices, which could be used to support Your Improved Process

  Design a wireframe prototype

Design a wireframe prototype to meet the needs of the personas and requirements.

  Explain the characteristics of visual studio 2005

Explain the characteristics of Visual Studio 2005.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd