Spell checker
时间限制: 2000ms内存限制: 65536kB
描述
You, as a member of a development team for a new spell checking program, are to write a module that will check the correctness of given words using a known dictionary of all correct words in all their forms.
If the word is absent in the dictionary then it can be replaced by correct words (from the dictionary) that can be obtained by one of the following operations:
?deleting of one letter from the word;
?replacing of one letter in the word with an arbitrary letter;
?inserting of one arbitrary letter into the word.
Your task is to write the program that will find all possible replacements from the dictionary for every given word.
输入
The first part of the input file contains all words from the dictionary. Each word occupies its own line. This part is finished by the single character '#' on a separate line. All words are different. There will be at most 10000 words in the dictionary.
The next part of the file contains all words that are to be checked. Each word occupies its own line. This part is also finished by the single character '#' on a separate line. There will be at most 50 words that are to be checked.
All words in the input file (words from the dictionary and words to be checked) consist only of small alphabetic characters and each one contains 15 characters at most.
输出
Write to the output file exactly one line for every checked word in the order of their appearance in the second part of the input file. If the word is correct (i.e. it exists in the dictionary) write the message: " is correct". If the word is not correct
then write this word first, then write the character ':' (colon), and after a single space write all its possible replacements, separated by spaces. The replacements should be written in the order of their appearance in the dictionary (in the first part of
the input file). If there are no replacements for this word then the line feed should immediately follow the colon.
样例输入
i
is
has
have
be
my
more
contest
me
too
if
award
#
me
aware
m
contest
hav
oo
or
i
fi
mre
#
样例输出
me is correct
aware: award
m: i my me
contest is correct
hav: has have
oo: too
or:
i is correct
fi: i
mre: more me
参考代码
分享到:
相关推荐
北大POJ1035-Spell checker 解题报告+AC代码
安卓开发-SpellChecker.zip
前端项目-jquery-spellchecker,一个轻量级jquery插件,可以检查表单域或DOM树中文本的拼写。
北大ACP-POJ 1035 - Spell checker 原比赛题目测试数据(问题G)
资源来自pypi官网。 资源全名:NlpToolkit-SpellChecker-1.0.12.tar.gz
var spellchecker = new $.SpellChecker('textarea', { lang: 'en', parser: 'text', webservice: { path: '../../webservices/php/SpellChecker.php', driver: 'pspell' }, suggestBox: { ...
npm install codemirror-spell-checker --save通过。 bower install codemirror-spell-checker --save通过 。 请注意,jsDelivr可能需要几天时间才能更新到最新版本。 < link rel =" stylesheet " href =" ...
Lucene SpellChecker for Lucene 3.0.2
jar包,亲测可用
java运行依赖jar包
SpellChecker节点模块 , 或本地绑定,具体取决于您的平台。 Windows 7及更低版本以及Linux将依赖Hunspell。 正在安装 npm install spellchecker 使用 SpellChecker = require ' spellchecker ' SpellChecker....
pysource-spellchecker 使用Enchant对Python源文件中的字符串和注释进行拼写检查 作者: 哈特穆特·戈贝尔< > 版本: 版本0.1.2 版权: 2012年:哈特穆特·戈贝尔 执照: GNU公共许可证v3(GPLv3) 主页:...
WoW-Spell-Editor-master |____Documentation BandingList对应dbc文件二进制字段列表,语言包 |____SpellGUIV2 核心代码 |____Binding dbc文件二进制字段 |____BLP BLP文件解析 |____Binding 关联*.dbc文件与...
Qt Creator 也具有拼写检查。前人栽树,后人乘凉。 Qt 5.12.0 测试通过,详见 http://blog.davidrobot.com/2019/02/qt-creator-spellchecker-plugin.html
简单的拼写检查器 一个简单快速的拼写检查器,带有拼写建议和Electron的集成 ... var SpellChecker = require ( 'simple-spellchecker' ) ; SpellChecker . getDictionary ( "fr-FR" , function ( err , dicti
主要是SpellChecker控件的用法总结
PHP-Spellchecker是PHP的拼写检查程序抽象库。 通过为许多不同的拼写检查器提供统一的界面,您可以交换拼写检查器而无需进行大量重写。 使用PHP-Spellchecker可以消除供应商锁定,减少技术负担,并提高代码的可测试...
电子拼写检查器 electronic-spellchecker是一个库,可帮助您在Electron应用程序中实施拼写检查,以及处理默认的右键单击上下文菜单(因为其中会显示拼写检查)。 该库旨在以一种易于生产的,国际友好的方式解决拼写...
python库。 资源全名:spellchecker-0.2.linux-x86_64.tar.gz
Inkdrop的拼写检查器插件 它将以浅红色突出显示所有拼写...ipm install spell-checker 改变语言 您可以从以下语言中更改语言:首选项->插件->拼写检查器->设置->语言: 版本历史 请参阅以获取每个更新中的更改概述。