Skip to content

Commit

Permalink
修正中英数之间的空白
Browse files Browse the repository at this point in the history
  • Loading branch information
JuanitoFatas committed Mar 29, 2012
1 parent 6ecc47f commit 124f134
Show file tree
Hide file tree
Showing 22 changed files with 74 additions and 74 deletions.
2 changes: 1 addition & 1 deletion index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Redis命令参考简体中文版

本文是\ `《Redis Command Reference》 <http://redis.io/commands>`_\ 的简体中文翻译版,原文共十个部分的\ **所有命令均已翻译完毕** 。

本文所有示例代码均经过Redis 2.4.4版本测试,质量保证。 提交翻译问题、加入本项目或联系译者,请阅读\ :ref:`readme`\ 页面。
本文所有示例代码均经过 Redis 2.4.4 版本测试,质量保证。 提交翻译问题、加入本项目或联系译者,请阅读\ :ref:`readme`\ 页面。

**目录(使用CTRL+F快速查找命令):**

Expand Down
2 changes: 1 addition & 1 deletion list.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

**空列表**

指不包含任何元素的列表,Redis将不存在的\ ``key``\ 也视为空列表。
指不包含任何元素的列表,Redis 将不存在的\ ``key``\ 也视为空列表。

.. include:: list/lpush.rst

Expand Down
2 changes: 1 addition & 1 deletion readme.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
报告翻译错误或加入本项目
========================

提交翻译错误、意见、建议,或加入本项目,请到\ `项目Github页面 <https://github.com/huangz1990/redis>`_\
提交翻译错误、意见、建议,或加入本项目,请到\ `项目 Github 页面 <https://github.com/huangz1990/redis>`_\

或直接联系译者。

Expand Down
8 changes: 4 additions & 4 deletions set.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,19 @@
A = {'a', 'b', 'c'}
B = {'a', 'e', 'i', 'o', 'u'}

inter(x, y): 交集,在集合x和集合y中都存在的元素
inter(x, y): 交集,在集合 x 和集合 y 中都存在的元素
inter(A, B) = {'a'}
union(x, y): 并集,在集合x中或集合y中的元素,如果一个元素在x和y中都出现,那只记录一次即可。
union(x, y): 并集,在集合 x 中或集合 y 中的元素,如果一个元素在 x 和 y 中都出现,那只记录一次即可。
union(A,B) = {'a', 'b', 'c', 'e', 'i', 'o', 'u'}

diff(x, y): 差集,在集合x中而不在集合y中的元素
diff(x, y): 差集,在集合 x 中而不在集合 y 中的元素
diff(A,B) = {'b', 'c'}

card(x): 基数,一个集合中元素的数量。
card(A) = 3

空集: 基数为0的集合
空集: 基数为 0 的集合

.. include:: set/sadd.rst

Expand Down
8 changes: 4 additions & 4 deletions string/append.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,16 @@ APPEND

::

# 情况1:对不存在的key执行APPEND
# 情况1:对不存在的 key 执行 APPEND

redis> EXISTS myphone # 确保myphone不存在
redis> EXISTS myphone # 确保 myphone 不存在
(integer) 0

redis> APPEND myphone "nokia" # 对不存在的key进行APPEND,等同于SET myphone "nokia"
redis> APPEND myphone "nokia" # 对不存在的 key 进行 APPEND,等同于 SET myphone "nokia"
(integer) 5 # 字符长度


# 情况2:对字符串进行APPEND
# 情况2:对字符串进行 APPEND

redis> APPEND myphone " - 1110"
(integer) 12 # 长度从5个字符增加到12个字符
Expand Down
6 changes: 3 additions & 3 deletions string/decr.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ DECR

::

# 情况1:对存在的数字值key进行DECR
# 情况1:对存在的数字值 key 进行 DECR

redis> SET failure_times 10
OK
Expand All @@ -32,7 +32,7 @@ DECR
(integer) 9


# 情况2:对不存在的key值进行DECR
# 情况2:对不存在的 key 值进行 DECR

redis> EXISTS count
(integer) 0
Expand All @@ -41,7 +41,7 @@ DECR
(integer) -1


# 情况3:对存在但不是数值的key进行DECR
# 情况3:对存在但不是数值的 key 进行 DECR

redis> SET company YOUR_CODE_SUCKS.LLC
OK
Expand Down
4 changes: 2 additions & 2 deletions string/decrby.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ DECRBY

::

# 情况1:对存在的数值key进行DECRBY
# 情况1:对存在的数值 key 进行 DECRBY

redis> SET count 100
OK
Expand All @@ -32,7 +32,7 @@ DECRBY
(integer) 80

# 情况2:对不存在的key进行DECRBY
# 情况2:对不存在的 key 进行DECRBY

redis> EXISTS pages
(integer) 0
Expand Down
4 changes: 2 additions & 2 deletions string/getbit.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ GETBIT

::
# 情况1:对不存在的key/不存在的offset进行GETBIT
# 情况1:对不存在的 key 或不存在的 offset 进行 GETBIT
# 默认为0

redis> EXISTS bit
Expand All @@ -27,7 +27,7 @@ GETBIT
(integer) 0

# 情况2:对已存在的offset进行GETBIT
# 情况2:对已存在的 offset 进行 GETBIT

redis> SETBIT bit 10086 1
(integer) 0
Expand Down
2 changes: 1 addition & 1 deletion string/getrange.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ GETRANGE
截取得出的子字符串。

.. note::
在<=2.0的版本里,GETRANGE被叫作SUBSTR
在<=2.0的版本里,GETRANGE 被叫作 SUBSTR

::

Expand Down
6 changes: 3 additions & 3 deletions string/getset.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ GETSET
redis> EXISTS mail
(integer) 0

redis> GETSET mail [email protected] # 因为mail之前不存在,没有旧值,返回nil
redis> GETSET mail [email protected] # 因为 mail 之前不存在,没有旧值,返回 nil
(nil)

redis> GETSET mail [email protected] # mail被更新,旧值被返回
redis> GETSET mail [email protected] # mail 被更新,旧值被返回
"[email protected]"

模式
Expand All @@ -41,7 +41,7 @@ GETSET
redis> INCR mycount
(integer) 11

redis> GETSET mycount 0 # 一个原子内完成GET mycount和SET mycount 0操作
redis> GETSET mycount 0 # 一个原子内完成 GET mycount 和 SET mycount 0 操作
"11"

redis> GET mycount
Expand Down
8 changes: 4 additions & 4 deletions string/incr.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.. _incr:
.. _incr:

INCR
=====
Expand All @@ -11,7 +11,7 @@ INCR

如果值包含错误的类型,或字符串类型的值不能表示为数字,那么返回一个错误。

本操作的值限制在64位(bit)有符号数字表示之内。
本操作的值限制在 64 位(bit)有符号数字表示之内。

**时间复杂度:**
O(1)
Expand All @@ -20,7 +20,7 @@ INCR
执行\ `INCR`_\ 命令之后\ ``key``\ 的值。

.. note::
这是一个针对字符串的操作,因为Redis没有专用的整数类型,所以key内储存的字符串被解释为十进制64位有符号整数来执行INCR操作
这是一个针对字符串的操作,因为 Redis 没有专用的整数类型,所以 key 内储存的字符串被解释为十进制 64 位有符号整数来执行 INCR 操作

::
Expand All @@ -30,7 +30,7 @@ INCR
redis> INCR page_view
(integer) 21

redis> GET page_view # 数字值在Redis中以字符串的形式保存
redis> GET page_view # 数字值在 Redis 中以字符串的形式保存
"21"

模式:计数器
Expand Down
8 changes: 4 additions & 4 deletions string/incrby.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ INCRBY

如果值包含错误的类型,或字符串类型的值不能表示为数字,那么返回一个错误。

本操作的值限制在64位(bit)有符号数字表示之内。
本操作的值限制在 64 位(bit)有符号数字表示之内。

关于更多递增(increment)/递减(decrement)操作信息,参见\ `INCR`_\ 命令。

Expand All @@ -23,7 +23,7 @@ INCRBY

::
# 情况1:key存在且是数字值
# 情况1:key 存在且是数字值

redis> SET rank 50 # 设置rank为50
OK
Expand All @@ -35,7 +35,7 @@ INCRBY
"70"


# 情况2:key不存在
# 情况2:key 不存在

redis> EXISTS counter
(integer) 0
Expand All @@ -47,7 +47,7 @@ INCRBY
"30"


# 情况3:key不是数字值
# 情况3:key 不是数字值

redis> SET book "long long ago..."
OK
Expand Down
2 changes: 1 addition & 1 deletion string/incrbyfloat.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ INCRBYFLOAT

当以下任意一个条件发生时,返回一个错误:

- ``key`` 的值不是字符串类型(因为 redis 中的数字和浮点数都以字符串的形式保存,所以它们都属于字符串类型)
- ``key`` 的值不是字符串类型(因为 Redis 中的数字和浮点数都以字符串的形式保存,所以它们都属于字符串类型)
- ``key`` 当前的值或者给定的增量 ``increment`` 不能解释(parse)为双精度浮点数(double precision floating point number)

**可用版本:**
Expand Down
4 changes: 2 additions & 2 deletions string/mget.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ MGET

::

redis> MSET name huangz twitter twitter.com/huangz1990 #用MSET一次储存多个值
redis> MSET name huangz twitter twitter.com/huangz1990 #用 MSET 一次储存多个值
OK

redis> MGET name twitter
Expand All @@ -26,7 +26,7 @@ MGET
redis> EXISTS fake_key
(integer) 0

redis> MGET name fake_key # 当MGET中有不存在key的情况
redis> MGET name fake_key # 当 MGET 中有不存在 key 的情况
1) "huangz"
2) (nil)

Expand Down
4 changes: 2 additions & 2 deletions string/mset.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ MSET
redis> MSET date "2011.4.18" time "9.09a.m." weather "sunny"
OK

redis> KEYS * # 确保指定的三个key-value对被插入
redis> KEYS * # 确保指定的三个 key-value 对被插入
1) "time"
2) "weather"
3) "date"

redis> SET google "google.cn" # MSET覆盖旧值的例子
redis> SET google "google.cn" # MSET 覆盖旧值的例子
OK

redis> MSET google "google.hk"
Expand Down
8 changes: 4 additions & 4 deletions string/msetnx.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,21 @@ MSETNX
::

# 情况1:对不存在的key进行MSETNX
# 情况1:对不存在的 key 进行 MSETNX

redis> MSETNX rmdbs "MySQL" nosql "MongoDB" key-value-store "redis"
(integer) 1


# 情况2:对已存在的key进行MSETNX

redis> MSETNX rmdbs "Sqlite" language "python" # rmdbs键已经存在,操作失败
redis> MSETNX rmdbs "Sqlite" language "python" # rmdbs 键已经存在,操作失败
(integer) 0

redis> EXISTS language # 因为操作是原子性的,language没有被设置
redis> EXISTS language # 因为操作是原子性的,language 没有被设置
(integer) 0

redis> GET rmdbs # rmdbs没有被修改
redis> GET rmdbs # rmdbs 没有被修改
"MySQL"

redis> MGET rmdbs nosql key-value-store
Expand Down
4 changes: 2 additions & 2 deletions string/set.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ SET

::

# 情况1:对字符串类型的key进行SET
# 情况1:对字符串类型的 key 进行 SET

redis> SET apple www.apple.com
OK
Expand All @@ -26,7 +26,7 @@ SET
"www.apple.com"


# 情况2:对非字符串类型的key进行SET
# 情况2:对非字符串类型的 key 进行 SET

redis> LPUSH greet_list "hello" # 建立一个列表
(integer) 1
Expand Down
2 changes: 1 addition & 1 deletion string/setbit.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ SETBIT
**返回值:**
指定偏移量原来储存的位。

.. warning:: 对使用大的\ ``offset``\ 的\ `SETBIT`_\ 操作来说,内存分配可能造成Redis服务器被阻塞。具体参考\ `SETRANGE`_\ 命令,warning(警告)部分。
.. warning:: 对使用大的\ ``offset``\ 的\ `SETBIT`_\ 操作来说,内存分配可能造成 Redis 服务器被阻塞。具体参考\ `SETRANGE`_\ 命令,warning(警告)部分。

::

Expand Down
6 changes: 3 additions & 3 deletions string/setex.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ SETEX
SET key value
EXPIRE key seconds # 设置生存时间

不同之处是,\ `SETEX`_\ 是一个原子性(atomic)操作,关联值和设置生存时间两个动作会在同一时间内完成,该命令在Redis用作缓存时,非常实用。
不同之处是,\ `SETEX`_\ 是一个原子性(atomic)操作,关联值和设置生存时间两个动作会在同一时间内完成,该命令在 Redis 用作缓存时,非常实用。

**时间复杂度:**
O(1)
Expand All @@ -27,7 +27,7 @@ SETEX
::

# 情况1:key不存在
# 情况1:key 不存在

redis> SETEX cache_user_id 60 10086
OK
Expand All @@ -39,7 +39,7 @@ SETEX
(integer) 49


# 情况2:key已经存在,key被覆写
# 情况2:key 已经存在,key 被覆写

redis> SET cd "timeless"
OK
Expand Down
Loading

0 comments on commit 124f134

Please sign in to comment.