the sun also rises day6

本文记录了一系列生活琐事和个人感悟,包括阅读体验、战争创伤、人际交往、女性话题及个人成长等方面的内容,展现了作者对生活的深刻理解和独到见解。

1.I read it all the way through, including the Petite Correspondance and the Cornigrams.
我从头到尾看了一遍,包括读者小信箱栏和斗牛节目单。

2.Well, it was a rotten way / to be wounded andflying / on a joke front like the Italian.
唉,在意大利那被人当作笑柄的战线受了伤并溃逃,真不光彩啊

3.What a speech! I would like to have it illuminated/ to hang in the office.
讲得多精彩啊!我多想把这句话镶起来然后挂在写字间的墙上。

4.I try and play it along and just not make trouble for people
现在我尽量把它看得淡薄些,只求不要给别人带来烦恼

5.Good advice, anyway. Not to think about it. Oh, it was swell advice. Try and take it sometime. Try and take it.
反正是一番忠言吧。不要去想它。哦,真是一番忠言。今后就忍着点吧。就忍着点吧。

6."There's a species of woman here who's waked the whole street up. What kind of a dirty business at this time of night!"
“这里来了一个不知道什么名堂的女人,她把整条街的人都吵醒了。深更半夜嚷成这个样子,真不像话!”

7."Knows hell's own amount about people.
“多懂得人情世故啊。

8."He's putting up for Zizi, you know."
“你知道的,他正在资助齐齐。

9."I say, you are slow on the up-take," she said.
“咳,你反应太迟钝了,”她说道。

要画出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等)来绘制。 - 每个阶段用一个矩形框表示,并用箭头连接表示数据流向。 - 在每个阶段的框内详细标注该阶段的操作和数据变化。
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值