Skip to content

Commit 3c25f31

Browse files
committed
Update readme
1 parent 8e6f5f9 commit 3c25f31

File tree

2 files changed

+13
-12
lines changed

2 files changed

+13
-12
lines changed

README.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,60 +23,58 @@ import detectlanguage
2323
detectlanguage.configuration.api_key = "YOUR API KEY"
2424

2525
# You can use proxy if needed
26-
# detectlanguage.configuration.proxies = {'https': 'https://user:pass@proxy.example.com:8080'}
26+
# detectlanguage.configuration.proxies = {'https': 'https://user:pass@proxy:8080'}
2727
```
2828

2929
## Usage
3030

3131
### Language detection
3232

3333
```python
34-
detectlanguage.detect("Buenos dias señor")
34+
detectlanguage.detect("Dolce far niente")
3535
```
3636

3737
#### Result
3838

3939
```python
40-
[{'isReliable': True, 'confidence': 12.04, 'language': 'es'}]
40+
[{'language': 'it', 'score': 0.5074}]
4141
```
4242

4343
### Simple language detection
4444

45-
If you need just a language code you can use `simple_detect`. It returns just the language code.
45+
If you need just a language code you can use `detect_code`.
4646

4747
```python
48-
detectlanguage.simple_detect("Buenos dias señor")
48+
detectlanguage.detect_code("Dolce far niente")
4949
```
5050

5151
#### Result
5252

5353
```python
54-
'es'
54+
'it'
5555
```
5656

5757
### Batch detection
5858

5959
It is possible to detect language of several texts with one request.
6060
This method is faster than doing one request per text.
61-
To use batch detection just pass array of texts to `detect` method.
6261

6362
```python
64-
detectlanguage.detect(["Buenos dias señor", "Labas rytas"])
63+
detectlanguage.detect_batch(["Dolce far niente", "Hello world"])
6564
```
6665

6766
#### Result
6867

6968
Result is array of detections in the same order as the texts were passed.
7069

7170
```python
72-
[ [ {'isReliable': True, 'confidence': 12.04, 'language': 'es'} ],
73-
[ {'isReliable': True, 'confidence': 9.38, 'language': 'lt'} ] ]
71+
[[{'language': 'it', 'score': 0.5074}], [{'language': 'en', 'score': 0.9098}]]
7472
```
7573

7674
### Getting your account status
7775

7876
```python
79-
detectlanguage.user_status()
77+
detectlanguage.account_status()
8078
```
8179

8280
#### Result
@@ -95,7 +93,9 @@ detectlanguage.languages()
9593

9694
#### Result
9795

98-
Array of language codes and names.
96+
```python
97+
[{'code': 'aa', 'name': 'Afar'}, {'code': 'ab', 'name': 'Abkhazian'}, ...]
98+
```
9999

100100
## Contribution
101101

mise.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ test = "pytest"
99
test-cov = "pytest --cov=detectlanguage --cov-report=term-missing"
1010
test-verbose = "pytest -v"
1111
install-dev = "pip install -r requirements.txt && pip install -r test-requirements.txt"
12+
console = "python -c \"import detectlanguage; import code; code.interact(local=locals())\""

0 commit comments

Comments
 (0)