求全解,俺的作业啊。。。5555,救救俺。。。 文本中的语法查错!

miyostudio 2001-05-24 11:21:00
Coursework Specification Two – Spell-Checking Program
Submission Date: 15th June 2001
Specification:
Write a C++ program which maintains an internal dictionary of words. The program should use this dictionary of words to perform basic spell-checking on plain text files.
Technicalities:
Your program should store its internal dictionary of words in a suitable data structure that facilitates fast insertion and searching.
These words should be loaded into the data structure from a data file called ‘dictionary’. This file should comprise a list of words, each of which is on a separate line.
The internal dictionary of words should be saved back to the dictionary data file upon program termination to reflect any amendments made.
Functionality (Minimal):
Your program should allow the user to perform the following tasks-
· Add words to its internal dictionary
· Search for a word in the dictionary. The program should notify the user of search success or failure.
· Specify the filename of a plain text file for spell-checking
· The spell-checking process should include the following-
· Report any erroneous spellings (words in the text file not found in the internal dictionary) to the user.
· Allow the user to select whether each erroneous spelling should be added to the internal dictionary or ignored.
· Produce a final report on the screen. This final report should include-
· Number of word in the text file
· Number of erroneous spellings found
Functionality (Intermediate):
For extra marks you can add some of the following functionality to your program:
· Allow the user to delete words from the dictionary
· Output to screen / file a list of all words stored in the internal dictionary
· Add to the final report-
· Number of new words added to the internal dictionary
· Number of erroneous spellings not added to the internal dictionary
Functionality (Advanced):
For bonus marks you could try to implement some of the following-
· Enable your program to create a corrected copy of the text file, called ‘<filename>_corrected’ where filename is the name of the text file being spell-checked. This would be identical to the original except wherever spelling mistakes were found, and a correction was supplied by the user, the word would be replaced.
· Add text file statistics to the final report-
· Total number of sentences / paragraphs
· Average characters per word
· Average words per sentence
· Average sentences per paragraph
· When erroneous spellings are found, get your program to suggest a ‘best guess’ alternative from its internal dictionary (hard!).
Submission:
Create a directory called ‘cwk2’ within your ‘swe’ directory on UNIX. Within this directory place your source-code (.cpp) file and your executable program file.
These files will be collected from this directory automatically at 5:00 pm on 15th June 2001.
Notes:
You can assume that the text files to be spell-checked are composed of alphanumeric text (letters, numbers punctuation). You need not account for any special formatting.
I will be testing you programs with my own dictionary and text files. Please do not leave your own dictionary files in your ‘cwk1’ directories.
You may assume, if you need to, that the internal dictionary will be no greater than 5,000 words in size, and that no words are more that 10 letters long.
Your program must compile and run under Unix. Be careful if developing with Windows based compilers - there may be some incompatibilities.

...全文
57 1 打赏 收藏 举报
写回复
1 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
icbm 2001-05-25
问题我全都看了,问题很有意思。

题目不是很难,但是比较繁。如果你是个MM并且请我吃顿饭,可以帮做(实现Functionality (Advanced))。

请问你是那所学校的?居然会有老师给学生出这样的题目。


  • 打赏
  • 举报
回复
相关推荐
数据结构第16次作业,hash表 Spellchecking Prerequisites, Goals, and Outcomes Prerequisites: Students should have mastered the following prerequisite skills. • Hash Tables - Understanding of the concept of a recursive function • Inheritance - Enhancing an existing data structure through specialization Goals: This assignment is designed to reinforce the student's understanding of the use of hash tables as searchable containers. Outcomes: Students successfully completing this assignment would master the following outcomes. • Familiarize how to use hash tables, specifically hash sets Background Any word processing application will typically contain a spell check feature. Not only does this feature point out potentially misspelled words; it also suggests possible corrections. Description The program to be completed for this assessment is a spell checker. Below is a screen shot of the program in execution? The program begins by opening a word list text file, specified by a command line parameter. The program outputs an error message and terminates if it cannot open the specified word list text file. A sample word list text file (wordlist.txt) is given in the supplied wordlist.zip archive. After successfully opening the specified word list text file, the program then stores each word into a hash table. The program then opens a file to spell check. This user specifies this file through the command line. After opening this file, the program then compares each word in the file against the words stored in the hash table. The program considers a word to be misspelled if the word does not exist in the hash table. When this occurs, the program displays the line number the word appeared in, the word, and a list of possible corrections. The list of possible corrections for a misspelled word is generated using a simple algorithm. Any variation of a misspelled word that is itself a word (i.e. it is found in the word list file) is a possible correction. Your solution to this asses
发帖
C语言

6.6w+

社区成员

C语言相关问题讨论
社区管理员
  • C语言
  • 花神庙码农
  • 架构师李肯
加入社区
帖子事件
创建了帖子
2001-05-24 11:21
社区公告
暂无公告