the sun also rises day5

在城市的夜晚,街道被翻开,人们在电石灯的照耀下辛勤工作。一对情侣,Jake和Breets,尽管彼此深爱,却因战争创伤、内心的恐惧和痛苦而难以靠近。他们试图在酒吧中寻找慰藉,但最终还是各自面对自己的困境。

1.the street was tore up and men were working on the car-track by the light of acetylene flares.

街道被翻开,人们在电石灯的照耀下在电车轨道上工作。

2."love you?" i simply turn all to jelly when you touch me.
"爱你?"你一碰我浑身就打颤

3.she was looking into my eyes with the way that she had of looking that made you whether she was  looking out of her eyes.
她用那惯常的方式看和我的眼睛,然人怀疑她是否在用她的眼睛看着别人。

4.they would look on and on after every one else's in the world had stopped looking.
仿佛等到世界上所有人的眼睛都不在看了,他们也不会停止看。

5.she looked as though there were nothing in the earth she would not look like that, and really she was afraid so many things.
她用着看世界上任何一样东西的眼神看着我,实际上有那么多的东西她不敢正视。

6.when i think of hell i've put chaps all through, i'm paying for it all now.
我想到我给很多人带来了痛苦,我现在正在偿还这些。

7.at one or another i had probably considerd it from the most various angles, including the one that certain injuries or imperfections are a subject merriment while remaining quite serious for the person possessing them.
有那么几次,我从绝大多数的角度来想, 包括某些创伤那估,或则和残疾,虽然对于残疾人来说是一件严肃的事情,但对于别人来说确实可以取乐的对象。

8.oh,some one took her home, not a bad-looking girl, wonderful command of the idiom.
有人带她回家了,一个长的不错的女孩,满满的行话。

 

obviously jake and breet into each othser, but there must soms barriers between the two, breet said that she was misrable, said that she was paying all the hell.and jake was sick that carried during the war. they get off the car and went into the bar and met some old frieds, but jake out of that after a while while breet still stay in. thay date torrow in the park.


 

要画出MapReduce对这两个文件进行单词统计的过程示意图,以下是各个步骤及对应的解释,可根据这些步骤来绘制示意图: ### 1. 输入分割 将两个文件分别进行分割,按照行进行切分。 - 文件1: - “East is a direction.” - “The sun rises in the east.” - “East is the opposite of west.” - 文件2: - “West is a direction.” - “The sun sets in the west.” - “West is the opposite of east.” ### 2. Map阶段 对每一行进行单词分割,并输出键值对(单词,1)。 - 对于文件1的第一行 “East is a direction.”,输出:(East, 1), (is, 1), (a, 1), (direction, 1) - 以此类推,对所有行进行处理。 ### 3. Map端排序 Map输出的键值对会按照键(单词)进行排序。例如,会将所有以 “a” 开头的单词放在一起,“b” 开头的单词放在一起,依此类推。 ### 4. Combine阶段 在Map端进行局部聚合,对相同键(单词)的值进行求和。例如,如果有多个 (East, 1),会合并为 (East, n),n 是 “East” 出现的次数。 ### 5. Shuffle阶段 将Map端的输出根据键(单词)分发到不同的Reduce任务中。例如,所有 “East” 的键值对会被发送到同一个Reduce任务。 ### 6. Reduce阶段 Reduce任务接收相同键(单词)的所有键值对,并对值进行求和。例如,接收 (East, 2), (East, 1) 会合并为 (East, 3)。 ### 7. Reduce端排序 Reduce输出的结果会按照键(单词)再次进行排序,最终得到按字母顺序排列的单词统计结果。 ### 代码示例(Python伪代码) ```python # Map函数 def map_function(line): words = line.split() for word in words: yield (word.lower(), 1) # Combine函数 def combine_function(key_values): word_count = {} for key, value in key_values: if key in word_count: word_count[key] += value else: word_count[key] = value for key, value in word_count.items(): yield (key, value) # Reduce函数 def reduce_function(key, values): total = sum(values) return (key, total) # 模拟输入文件 file1 = ["East is a direction.", "The sun rises in the east.", "East is the opposite of west."] file2 = ["West is a direction.", "The sun sets in the west.", "West is the opposite of east."] # Map阶段 map_output = [] for line in file1 + file2: for key, value in map_function(line): map_output.append((key, value)) # Map端排序 map_output.sort() # Combine阶段 combine_output = [] current_key = None current_values = [] for key, value in map_output: if current_key is None: current_key = key if key == current_key: current_values.append(value) else: for result in combine_function([(current_key, v) for v in current_values]): combine_output.append(result) current_key = key current_values = [value] # 处理最后一组 for result in combine_function([(current_key, v) for v in current_values]): combine_output.append(result) # Shuffle阶段(模拟) shuffled_output = {} for key, value in combine_output: if key not in shuffled_output: shuffled_output[key] = [] shuffled_output[key].append(value) # Reduce阶段 reduce_output = [] for key, values in shuffled_output.items(): result = reduce_function(key, values) reduce_output.append(result) # Reduce端排序 reduce_output.sort() print(reduce_output) ``` ### 示意图绘制建议 - 可以使用流程图工具(如Visio、Draw.io等)来绘制。 - 每个阶段用一个矩形框表示,并用箭头连接表示数据流向。 - 在每个阶段的框内详细标注该阶段的操作和数据变化。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值