求全解,俺的作业啊。。。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.

...全文
70 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
icbm 2001-05-25
  • 打赏
  • 举报
回复
问题我全都看了,问题很有意思。

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

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


69,382

社区成员

发帖
与我相关
我的任务
社区描述
C语言相关问题讨论
社区管理员
  • C语言
  • 花神庙码农
  • 架构师李肯
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧