摘要: 上一个已经实现了反向索引,那么为什么不尝试下全文搜索呢。例如有了Hello file3.txt:1;MapReduce file3.txt:2;fil1.txt:1;fil2.txt:1;bye file3.txt:1;is fil1.txt:1;fil2.txt:2;powerful fil2.t... 阅读全文
posted @ 2015-06-01 10:26 sunrye 阅读(435) 评论(0) 推荐(0) 编辑
摘要: 反向索引主要用于全文搜索,就是形成一个word url这样的结构file1:MapReduce is simplefile2:MapReduce is powerful is simplefile3:Hello MapReduce bye MapReduce那么经过反向索引后就是:Hello fil... 阅读全文
posted @ 2015-06-01 10:25 sunrye 阅读(788) 评论(0) 推荐(0) 编辑
摘要: 题目描述:现在有两个文件,1为存放公司名字和城市ID,2为存放城市ID和城市名表一:factoryname,addressedBeijing Red Star,1Shenzhen Thunder,3Guangzhou Honda,2Beijing Rising,1Guangzhou Developm... 阅读全文
posted @ 2015-06-01 10:24 sunrye 阅读(548) 评论(0) 推荐(0) 编辑
摘要: 题目描述:根据给定的关系child parentTom LucyTom JackJone LucyJone JackLucy MaryLucy BenJack AliceJack JesseTerry AliceTerry JessePhilip TerryPhilip AlmaMark Terry... 阅读全文
posted @ 2015-06-01 10:23 sunrye 阅读(560) 评论(0) 推荐(0) 编辑
摘要: 思想比较简单,就是每个通过map来获取当前的数据块中的的topk个数据,然后将他们以相同的key值放到reduce中,最后通过reduce来对这n*k个数据排序并获得topk个数据。具体的就是建立一个k个大小的数组,一开始初始化为都是100(假定这里的100是最大的数),然后往里面插数据小的数据即可... 阅读全文
posted @ 2015-06-01 10:22 sunrye 阅读(860) 评论(0) 推荐(0) 编辑
摘要: 参考了廖雪峰的Python博客。web请求顺序:浏览器发送一个http请求服务器收到请求后,生成一个html文档。服务器将html文档作为http相应的body发送给浏览器浏览器收到http响应,从http的body中取出html文档并在浏览器上显示通过wsgi接口可以屏蔽底层的函数,安心写web。... 阅读全文
posted @ 2015-04-02 10:39 sunrye 阅读(443) 评论(0) 推荐(1) 编辑
摘要: a={'a':{'b':{'c':{'d':'e'}},'f':'g'},'h':'i'}def show(myMap): for str in myMap.keys(): secondDict=myMap[str] print str if type(myMap[str]).__name_... 阅读全文
posted @ 2015-03-20 21:33 sunrye 阅读(1126) 评论(0) 推荐(0) 编辑