1. Problem

Write a program that reads a large list of English words (e.g. from /usr/share/dict/words on a unix system) into memory, and then reads words from stdin, and prints either the best spelling suggestion, or “NO SUGGESTION” if no suggestion can be found. The program should print “>” as a prompt before reading each word, and should loop until killed.

Your solution should be faster than O(n) per word checked, where n is the length of the dictionary. That is to say, you can’t scan the dictionary every time you want to spellcheck a word.

For example:

  1. >sheeeeep
  2. sheep
  3. >peepple
  4. people
  5. >sheeple
  6. NO SUGGESTION

The class of spelling mistakes to be corrected is as follows:

Case (upper/lower) errors:

  1. "inSIDE" => "inside"

Repeated letters:

  1. "jjoobbb" => "job"

Incorrect vowels:

  1. "weke" => "wake"

In addition, any combination of the above types of error in a single word should be corrected (e.g. "CUNsperrICY" => "conspiracy").

If there are many possible corrections of an input word, your program can choose one in any way you like, however your results must match the examples above (e.g. "sheeeeep" should return "sheep" and not "shap").

Final step: Write a second program that generates words with spelling mistakes of the above form, starting with correctly spelled English words. Pipe its output into the first program and verify that there are no occurrences of “NO SUGGESTION” in the output.

2. Solution

- See more at: http://bo-yang.github.io/2014/09/13/spell-checker/#sthash.67cPBa6r.dpuf

http://bo-yang.github.io/2014/09/13/spell-checker

Spell Checker相关推荐

  1. android studio spellchecker,Exclude files from Android Studio lint spell checker

    问题 The Android Studio lint spell checker flags hex codes that look to it like words in certain files ...

  2. 论文阅读-FASPell: A Fast, Adaptable, Simple, Powerful Chinese Spell Checker Based

    来源:爱奇艺 EMNLP2019 Workshop 论文:https://aclanthology.org/D19-5522.pdf 代码:GitHub - iqiyi/FASPell: 2019-S ...

  3. vscode php代码检测,VSCODE代码拼写检查插件Code Spell Checker

    Code Spell Checker是一款VSCODE代码拼写检查插件,可以为开发者报告一些常见的拼写错误.这个拼写检查程序的目标是帮助捕获常见的拼写错误,同时保持低误报的数量.它很适合驼峰式代码. ...

  4. POJ 1035, Spell checker

    brutal force 1. 生成字典, 并按长度排序. 2. 对于给定单词, 取得区间 [单词长度 - 1, 单词长度 + 1], 并匹配. 3. 如果存在完全匹配的单词, 打印输出, 否则把可能 ...

  5. POJ-1035 Spell checker 暴力

    直接暴力. 代码如下: #include <cstring> #include <cstdio> #include <cstdlib> #include <m ...

  6. poj 1035 Spell checker(hash)

    题目链接:http://poj.org/problem?id=1035 思路分析: 1.使用哈希表存储字典 2.对待查找的word在字典中查找,查找成功输出查找成功信息 3.若查找不成功,对word增 ...

  7. POJ 2341 Spell checker 笔记

    找出句首单词首字母小写和大写字母不是单词的第一个字母的错误.

  8. 【论文阅读】ReaLiSe:Read, Listen, and See: Leveraging Multimodal Information Helps Chinese Spell Checking

    文章目录 本篇论文所需基础 论文内容 摘要(Abstract) 1. 介绍(Introduction)(略) 2. 相关工作 3. 模型部分(The REALISE Model) 3.1 语义编码器( ...

  9. 字符串编辑距离(Edit Distance)

    一.问题描述 定义 字符串编辑距离(Edit Distance),是俄罗斯科学家 Vladimir Levenshtein 在 1965 年提出的概念,又称 Levenshtein 距离,是指两个字符 ...

  10. 直接上手!不容错过的Visual Studio Code十大扩展组件

    作者 | David Neal 译者 | 谭开朗,责编 | 屠敏 转载自CSDN(ID:CSDNnews) 各大平台与各种语言的开发人员都在使用Visual Studio Code,我对此感到惊讶.S ...

最新文章

  1. java爬虫框架动态_java爬虫框架webmagic
  2. JavaScript实现isPowerOfTwo算法(附完整源码)
  3. 修复病毒破坏的文件关联并恢复程序图标
  4. React+Webpack+Webstorm开发环境搭建
  5. 什么是GSD文件以及如何在STEP7和TIA博途中安装GSD文件?
  6. 初识C语言——C语言基础知识
  7. 云盘+Git GUI实现云盘文件版本控制
  8. python合并相同内容单元格_快速合并单元格相同项的内容
  9. matplotlib画柱状图
  10. 有钱就能赞助FIFA世界杯?NO!看雅迪电动车的全球征程
  11. 牛客国庆集训派对Day1 New Game!+计算几何
  12. 02 食尚年华石锅土鲫鱼需求简单描述
  13. 手机短信真的可信吗# 传统短信伪造攻击的可能性证明
  14. 对谈 | 创新与进化——当开源接受SaaS
  15. C# 编写Windows Service(windows服务程序)(第二种)
  16. 卡西欧计算机的闹铃怎么取消,卡西欧g-shock怎么关闹钟
  17. java 笛卡尔积 数组_在JS中笛卡尔积算法与多重数组笛卡尔积(详细教程)
  18. 金士顿固态硬盘不认盘修复_#原创新人#老司机带你玩转PC,故障之SSD篇 篇一:金士顿 V300 240G SATA3 固态硬盘 丢盘掉速解决记录...
  19. c语言 剪子包袱锤游戏,幼儿民间游戏:“剪子、包袱、锤”的多种玩法
  20. 第六周项目6.3 友元函数实现复数的加法

热门文章

  1. 北京内推 | 启元世界招聘虚拟人算法工程师/实习生
  2. uefi 懒人版黑苹果_macOS Sierra 10.12.6(16G29) 变色龙引导懒人版CDR黑苹果镜像
  3. struts2 拦截器
  4. Android开发环境配置(内有完整过程配图)
  5. 游戏制作大师RPGMAKER MV/MZ安装DLC的方法
  6. Linux架设DNS服务器(ChinaITLab.com 搜集整理)
  7. 大数据超详细面试题汇总(附答案)
  8. Access操作必须使用一个可更新的查询
  9. 《动手学深度学习》Task06-3:词嵌入进阶
  10. net项目怎么兼容Java_是否能让JAVA 和 .net框架共存