编程风格:程序设计与系统构建的艺术(原书第2版)
上QQ阅读APP看本书,新人免费读10天
设备和账号都新为新人

单词的上下文

对于给定的文本文件,按字母顺序显示某些单词和它的上下文,以及它们出现的页码。假设每页45行文字。假设上下文单词包含前面两个词及后面两个词。忽略标点符号。例如,对于给定的《傲慢与偏见》,单词“concealment”和“hurt”的上下文结果输出如下:

pcrhaps this concealment this disguise-150

purpose of concealment for no-207

pride was hurt he suffered-87

must bc hurt by such-95

and are hurt ifi-103

pride been hurt by my-115

must, be hurt by such-157

infamy was hurt and distressed-248

(给定单词的)上下文任务中的单词有:concealment、discontented、hurt、agitation、mortifying、reproach、unexpected、indignation、mistake和confusion。