斯卡布罗集市

斯卡布罗集市

http://www.veggiesky.com/uploadfiles/sarah_brightman_scarborough_fair.asf

很多人都对太极急支糖浆的广告音乐印象深刻,到处打听出处。其实这是一首动人的美国乡村歌曲,名字叫斯卡布罗集市,是美国七十年代巨片《毕业生》的主题歌,片子主角是由 达斯汀`霍夫曼主演,并一举奠定奥斯卡影帝的地位。原唱是保罗.西蒙。它在国内流传也很广,很多歌手都翻唱过。
Are you going to Scarborough Fair
Parsley,sage,rosemary and thyme
Remember me to one who lives there
She once was a true love of mine*

Tell her to make me a cambric shirt
(Oh the side of a hill in the deep forest green)
Parsley,sage,rosemary and thyme
(Tracing of sparrow on the snow crested brown)
Without no seams nor needle work
(Blankets and bedclothes the child of the mountain)
Then she`ll be ture love of main
(Sleeps unaware of the clarion call)

Tell her to find me an acre of land
(On the side of a hill a sprinkling of leaves)
Parsley,sage,rosemary and thyme
(Washes the grave with silvery tears)
Between the salt water and the sea strand
(A soldier cleans and publishes a gun)
Then she`ll be a true love of mine

Tell her to reap it with a sickle of leather
(War bells blazing in scarlet battalion)
Parsley,sage,rosemary and thyme
(Generals order their soldiers to kill)
And gather it all in a bunch of heather
(And to fight for a cause they`ve long ago forgotten)
Then she`ll be a true love of mine

斯卡布罗集市

您去过斯卡布罗集市吗?
芜荽,鼠尾草,迷迭香和百里香
代我向那儿的一位姑娘问好
她曾经是我的爱人.

叫她替我做件麻布衣衫
(绿林深处山刚旁)
芜荽,鼠尾草,迷迭香和百里香
(在白雪封顶的褐色山上追逐雀儿)
上面不用缝口,也不用针线
(大山是山之子的地毯和床单)
她就会是我真正的爱人.
(熟睡中不觉号角声声呼唤)

叫她替我找一块地
(从小山旁几片小草叶上)
芜荽,鼠尾草,迷迭香和百里香
(滴下的银色泪珠冲刷着坟茔)
就在咸水和大海之间
(士兵擦拭着他的枪)
她就会是我真正的爱人.

叫她用一把皮镰收割
(战火轰隆,猩红的枪弹在狂呼)
芜荽,鼠尾草,迷迭香和百里香
(将军们命令麾下的士兵杀戮)
将收割的石楠扎成一束
(为一个早已遗忘的理由而战)
她就会是我真正的爱人.

 
```python if all(ord(char) < 128 for char in item): ``` 这行代码的作用是:**判断字符串 `item` 中的所有字符是否都是 ASCII 码小于 128 的字符**,也就是判断这一行是否 **不包含中文或其他非 ASCII 字符(如 emoji、特殊符号等)**。 --- ### 🔍 逐部分解释: #### 1. `for char in item` - 遍历字符串 `item` 中的每一个字符。 - 比如 `item = "Hello"`,那么 `char` 会依次是 `'H'`, `'e'`, `'l'`, `'l'`, `'o'`。 #### 2. `ord(char)` - `ord()` 函数返回一个字符对应的 Unicode 编码(对于 ASCII 字符就是 ASCII 码)。 - 例如: - `ord('A')` → 65 - `ord('a')` → 97 - `ord(' ')` → 32(空格) - `ord('你')` → 20320(远大于 128) #### 3. `ord(char) < 128` - 判断这个字符的编码值是否小于 128。 - 所有标准英文字符(字母、数字、标点、空格)都在 ASCII 范围内(0–127)。 - 中文、日文、韩文等汉字通常从 Unicode 编码 19968 开始(即 `一` 是 `\u4e00`),都远大于 128。 ✅ 所以这个条件可以用来区分“纯英文”和“含中文”的文本。 #### 4. `( ... for char in item)` - 这是一个**生成器表达式**,它对字符串中每个字符计算 `ord(char) < 128`,产生一系列布尔值。 举例: ```python item = "Hello" # 生成器展开为: [ord('H')<128, ord('e')<128, ord('l')<128, ord('l')<128, ord('o')<128] → [True, True, True, True, True] ``` ```python item = "你好" # 生成器展开为: [ord('你')<128, ord('好')<128] → [False, False] ``` #### 5. `all(...)` - `all()` 函数接收一个可迭代的布尔值序列,只有当**所有值都是 `True`** 时,才返回 `True`;只要有一个 `False`,就返回 `False`。 所以: - `all(ord(char) < 128 for char in item)` → 只有当 `item` 中**每一个字符都是 ASCII 字符(即没有中文)** 时,结果才是 `True`。 --- ### ✅ 实际效果举例 | `item` | 是否满足条件 | 说明 | |--------|---------------|------| | `"Are you going to scarborough fair"` | ✅ `True` | 全是英文 | | `"你要去卡布罗集市吗"` | ❌ `False` | 包含中文 | | `"Parsley sage rosemary and thyme"` | ✅ `True` | 英文 | | `"给我捎个口信"` | ❌ `False` | 中文 | | `"Then he'll be a true love of mine"` | ✅ `True` | 含撇号但仍是 ASCII | --- ### 🧠 总结 > ```python > if all(ord(char) < 128 for char in item): > ``` > 这句话的意思是: > > “如果这一行中的**每一个字符的 ASCII 值都小于 128**,说明它是纯英文(不含中文或其它 Unicode 字符),就把它加入英文列表。” 这是在无正则、无第三方库情况下,快速过滤出英文行的一种常用技巧。 --- ###
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值