However, you can call feed as often as you want, and the parser will just keep parsing. So if you were worried about memory usage (or you knew you were going to be dealing with very large HTML pages), you could set this up in a loop, where you read a few bytes of HTML and fed it to the parser. The result would be the same.
[pope译] 然而{however},你可以在任何需要的时候调用feed,分析器{parser}可以提供分析。如果你担心存储的习惯用法(或者你知道你打算处理很长的html页面),你可以设置一个循环,当你处理html和使用分析器分析时,结果是相同的。([?]这段是说可以分开处理吗?那个memory usage是什么呢?)
[net 译 来源: http://woodpecker.org.cn/diveintopython/html_processing/all_together.html ]
然而,您可以按您的需要经常调用 feed,分析器将不停地进行分析。所以如果我们担心内存的使用 (或者我们已经知道了将要处理非常巨大的 HTML 页面) ,我们可以在一个循环中调用它,即我们读出一点 HTML 字节,就将其送进分析器。结果会是一样的。
【popexizhi:
- if you were worried about memory usage
[net 译] 如果我们担心内存的使用
[popexizhi] memory usage 好吧内存使用,我翻译的是存储的习惯使用,太不专业了,sorry一个
2.you could set this up in a loop
[pope译]你可以设置一个循环
[net 译]我们可以在一个循环中调用它
[popexizhi] set this up 在一个循环中,set up 设置 ,这个地方net译的补充很明确,可取。
3. where you read a few bytes of HTML and fed it to the parser.
[pope译]当你处理html和使用分析器分析时
[net 译]即我们读出一点 HTML 字节,就将其送进分析器
[popexizhi]
and 嘻嘻,这里pope翻译为和,好吧,直接看上面的翻译到还是看不出问题,连接上the result would be the same.就发现了,这里一定是 后续的操作,翻译为“就将其”绝对比和正确,但是可以改进为 “并”可能也不错
read a few bytes of HTML 阅读一段html ,自己的翻译联系上下文就看不懂了,这里的a few bytes 是上文very larg 的一部分 每次loop中的一部分,一定要翻译的
fed it to the parser 其实喂食给语法分析器parser挺形象的,直接翻译也不错。
】
没有评论:
发表评论