搜索引擎的本质就是,不断搜集各网站的内容,然后收录进自己的数据库,客户搜索某个关键字的时候,搜索引擎就在数据库中寻找对应的条目,并返回对应和网址。
1. 首先,假设有5个文件,分别有一段文本。
# 1.txt
t1 = '''I have a dream that my four little children will one day live in a nation where they will not be judged by the color of their skin but by the content of their character. I have a dream today.'''
# 2.txt
t2 = '''I have a dream that one day down in Alabama, with its vicious racists, . . . one day right there in Alabama little black boys and black girls will be able to join hands with little white boys and white girls as sisters and brothers. I have a dream today.'''
# 3.txt
t3 = '''I have a dream that one day every valley shall be exalted, every hill and mountain shall be made low, the rough places will be made plain, and the crooked places will be made straight, and the glory of the Lo