readme: update benchmark result and example codes
This commit is contained in:
parent
54602f6348
commit
242cc48eea
2 changed files with 4 additions and 4 deletions
|
@ -67,7 +67,7 @@ $ sudo easy_install cchardet
|
|||
```python
|
||||
# -*- coding: utf-8 -*-
|
||||
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()
|
||||
result = chardet.detect(msg)
|
||||
print(result)
|
||||
|
@ -103,7 +103,7 @@ Platform: Kubuntu 12.04 amd64, Python 2.7.3 64-bit
|
|||
<td>chardet</td><td>0.32</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>cchardet</td><td>1012.97</td>
|
||||
<td>cchardet</td><td>975.46</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
|
|
@ -76,7 +76,7 @@ Example
|
|||
|
||||
# -*- coding: utf-8 -*-
|
||||
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()
|
||||
result = chardet.detect(msg)
|
||||
print(result)
|
||||
|
@ -115,7 +115,7 @@ Result:
|
|||
|
||||
chardet: 0.32 (call/s)
|
||||
|
||||
cchardet: 1012.97 (call/s)
|
||||
cchardet: 975.32 (call/s)
|
||||
|
||||
License
|
||||
--------------
|
||||
|
|
Loading…
Reference in a new issue