Wednesday, November 30, 2011

languages

(按:写完后,发现此文甚水,而且处处强词夺理。不过有几个地方应该还有点道理,而且我这种人写出文章来就不舍得扔了,所以依然发表。权当博君一笑吧。)

用汉语,英语和法语表达“我是歌手”:


可以看到汉语和英语的语法都相对简单,而汉语更简单一点。上面的汉语例句中,系动词“是”和表语“歌手“没有任何变化,而英语还是保留了一些时态和语态的规则,虽然英语也在变得越来越简单 (趋向于所谓分析语)。

所以说,在语法和语音层面上 (暂且抛开文字不谈),汉语是一门很简单的语言。那些操着半吊子汉语,还在泡中国姑娘的老外,实在是懒 (抑或是幸运?)。

法国人一向以自己的语言自豪,而法语确实有一种独特的韵味。即使一句普通的话,比如 à la prochaine fois,意思明确,又不失美感。作为对比,英语怎样呢?Till the next time? 意思接近,但是显得别扭,做作;Goodbye, 又偏离原意了。汉语呢,“拜拜”估计是英语中来的,意思同样不准确,放在这也不应景;“再见”,倒正是这个意思,但是在大量使用下,已经丢掉了字面上的本意;不过汉语中确实有个好的,“回见”,虽然略显北京腔。

再看这个例子,传说路易十五曾经这样预言,“在我之后,洪水将至”。法语原文是 Après nous, le déluge。英语翻译是 After me, the flood。

法语依然韵味十足,而我们也能发现英语的一个特点,就是直接,practical。汉语呢,对一个事情往往能有多种表述。语法的简单意味着更少的拘束,更加灵活。

比如这句话 (来自亦舒的一句诗),彼之熊掌,我之砒霜;或者“彼之琼瑶,我之砒霜”;“彼之蜜糖,我之砒霜”;每一种表述,虽然含义相同,但都带有独特的风味。同样的意思,英语中的经典表述是 One man's food is another's poison. 好直接... 而且即使把 food/poison 换成别的组合,也不会给人不一样的感觉。那法语呢,有伏尔泰的一句话,Le malheur des uns fait le bonheur des autres. 还是法语的特点,表意明确,没有二义,韵味也不失。

汉语中,字词本身不会有语态时态的变化,而且字词的数量比较小 (相对拼音文字的单词),一句话的意思全靠句子结构、遣词造句来表达 (所谓分析语),所以句子往往很灵活,说一件事有很多说法,可以高贵,可以卑微,可以直接,可以含蓄。与之相对,英语中单词的意思一般比较单一,句子很少有附加或曲折的含义。

所以说汉语既简单,又灵活,是一种与法语不一样的博大精深。英语则完全是一种实用派的语言,有事说事,直截了当。这些语言都有自己的特点,很难说是优点,也很难说是缺点。

说起法语和法国人的自豪,有一个很重要的原因是法兰西学院,几百年来一直是法语的权威机构,主导法语的发展方向,保持着法语的纯正性。汉语和英语都没有类似的机构,所以两种语言发展的更自由,变化也更大。这一点同样无法评判是好是坏。

当然,很难想象如果有一个“中华学术院”会是个什么样子。极有可能,就沦为作协一样的傀儡了。

而且抛开文化不谈,单从语言特点上看,汉语更容易被操控。乌托邦文学中描述的极权政府经常会有对语言的控制,无论是一九八四中的“新话”,还是电影 V for Vendetta 中的 “I remember how the meaning of words began to change. ... I remember how "different" became dangerous.” 但是对拼音文字来说,这并不是那么的致命。因为他们有大量的词汇可以使用,更可以创造新词。但是汉语就不同,汉字和词语的数量都不大,很难造出新字或新词。如果一个字或词被操纵了,对整个语言的影响会很大。或者说,我们要想挤掉语言中的狼奶,会更难。

英语国家的女权运动中,对语言的修改是一种很重要的表现形式。而汉语中很难做类似的语言游戏。不只是女权运动,汉语就像这个国家一样,转身总是很艰难。

Tuesday, November 29, 2011

conary dir


Some conary recipe methods (including addArchive, Make, etc.) accept a "dir" parameter. It allows you to specify a custom directory within which to execute the action. What's confusing is that, its behavior is not so consistent (when dir is a relative directory).

addArchive() by default works inside the "builddir", usually ~/conary/builds/foobar/ (that is the buildPath; check your buildPath with `conary config | grep buildPath`). So an explicit "dir" argument for addArchive is relative to the builddir.

For Make(), MakeInstall(), etc., they work inside the "maindir", usually ~/conary/builds/foobar/foobar-1.0/. So "dir" for them is relative to maindir.

Here is an example.

Some time ago I needed to add an additional tarball to the conary package. This is what it takes.
r.addArchive('https://some/url/conary-bash-completion-0.2.tar.bz2', dir='%(maindir)s')
r.Make(dir='conary-bash-completion-0.2')
r.MakeInstall(dir='conary-bash-completion-0.2')
The tarball has such a structure,
$ tar tf conary-bash-completion-0.2.tar.bz2
conary-bash-completion-0.2/
conary-bash-completion-0.2/generate.py
conary-bash-completion-0.2/README
conary-bash-completion-0.2/Makefile
So, the addArchive() call will extract the tarball at the maindir, ~/conary/builds/conary/conary-2.3/. The files will be available under ~/conary/builds/conary/conary-2.3/conary-bash-completion-0.2. And Make and MakeInstall will work inside that directory.

Wednesday, November 23, 2011

whitespaces

两个 shell 小技巧,处理带有空格的文件名。

bash 里,用 for .. in (比如 for f in `cat some/file`; do ...) 或者其它方式 (比如 xargs, cat some/file | xargs ls -l) 处理文件的时候,如果文件名有空格,经常会遇到问题,因为本来是一行一行的文件会被当成一个长字符串,而 bash 和 xargs 在处理的时候,把空格和换行都当成分割符 ($IFS, internal field separator)。

这时候可以改 $IFS。但是它的用法好像比较微妙。所以如果需求很简单,也有一些很简单的应对办法。以下举两例。

1. for f in `cmd`; do ... 可以换成 cmd | while read f; do ...。比如,

cat some/file | while read f; do echo $f; done

2. xargs 可以利用 --delimiter=delim 参数,比如,

xargs -a some/file -d '\n' du -shc

Thursday, November 10, 2011

indefinite adjective

什么叫 indefinite adjective?
An indefinite adjective is an adjective formed from an indefinite pronoun.

The most common indefinite pronouns are: all, any, anyone, anything, each, everybody, everyone, everything, few, many, nobody, none, one, several, some, somebody, and someone.

When used as adjectives, these are known as "indefinite adjectives". (ref)
嗯,非限定性形容词。用作代词时是非限定性代词 / indefinite pronoun,用作形容词就是非限定性形容词

非限定性,也就是表示泛指。注意,“所有”“任何”也是泛指。

法语中与英语类似,常见的 indefinite adjective (adjectif indéfini) 包括 autre, aucun, certain, chaque, divers, différents, maint, même, n'importe, plusieurs, quelque, quelconque, tout, 等等。

tout 貌似是个很麻烦的东西,以后再整理。