readme: update benchmark result and example codes

This commit is contained in:
PyYoshi 2013-05-08 14:11:04 +09:00
parent 54602f6348
commit 242cc48eea
2 changed files with 4 additions and 4 deletions

View file

@ -67,7 +67,7 @@ $ sudo easy_install cchardet
```python ```python
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import cchardet as chardet import cchardet as chardet
with open(r"test/testdata/wikipediaJa_One_Thousand_and_One_Nights_SJIS.txt") as f: with open(r"test/testdata/wikipediaJa_One_Thousand_and_One_Nights_SJIS.txt", "rb") as f:
msg = f.read() msg = f.read()
result = chardet.detect(msg) result = chardet.detect(msg)
print(result) print(result)
@ -103,7 +103,7 @@ Platform: Kubuntu 12.04 amd64, Python 2.7.3 64-bit
<td>chardet</td><td>0.32</td> <td>chardet</td><td>0.32</td>
</tr> </tr>
<tr> <tr>
<td>cchardet</td><td>1012.97</td> <td>cchardet</td><td>975.46</td>
</tr> </tr>
</table> </table>

View file

@ -76,7 +76,7 @@ Example
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import cchardet as chardet import cchardet as chardet
with open(r"test/testdata/wikipediaJa_One_Thousand_and_One_Nights_SJIS.txt") as f: with open(r"test/testdata/wikipediaJa_One_Thousand_and_One_Nights_SJIS.txt", "rb") as f:
msg = f.read() msg = f.read()
result = chardet.detect(msg) result = chardet.detect(msg)
print(result) print(result)
@ -115,7 +115,7 @@ Result:
chardet: 0.32 (call/s) chardet: 0.32 (call/s)
cchardet: 1012.97 (call/s) cchardet: 975.32 (call/s)
License License
-------------- --------------