Bugfix: results of simple and rmmseg have unmatched size

Ruby 1.8 has no native unicode support, so we need a trick to get the
proper size of a Chinese string. If not, the returned array of Simple
and MMseg backend have different size, and which leads to wrong result.
E.g.

    Input: '非词感谢party, 感谢guo家!'

    Result of Simple backend:
        ["fei", "ci", "gan", "xie", "party", "gan", "xie", "guo", "jia"]

    Result of MMseg backend:
        [nil, nil, nil, nil, nil, nil, "gan", "xie", "party", "gan", "xie", "guo", nil, nil, nil]

    After apply patch (result of MMseg) on base (result of Simple):
        ["fei", "ci", "gan", "xie", "party,", "gan", "gan", "xie", "party!"]

Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
Replace accent character using sub instead of tr

When replace accent character in PinYin with normal English character,
do not use "tr", but use "sub" instead. Because for ruby 1.8, a accent
character is treat as two or more characters and when replace using
"tr", it will be replaced with two or more normal characters.
E.g.

    Input: jiǎ
    Replace with tr:  jiaa3
    Replace with sub: jia3

Signed-off-by: Jiang Xin <worldhello.net@gmail.com>